Skip to content

Commit

Permalink
Merge pull request #1473 from filipw/bugfix/nuget-hang
Browse files Browse the repository at this point in the history
fixed OmniSharp hanging on nuget references with wildcard
  • Loading branch information
bjorkstromm authored Apr 18, 2019
2 parents 6ac3149 + 7e243e0 commit 77a01df
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All changes to the project will be documented in this file.

## [1.32.xx] - not yet released
* Fixed logging for OmniSharp HTTP server (PR: [#1456](https://github.com/OmniSharp/omnisharp-roslyn/pull/1456))
* Fixed OmniSharp hanging on wildcard Nuget package references (PR: [#1473](https://github.com/OmniSharp/omnisharp-roslyn/pull/1473))

## [1.32.18] - 2019-04-12
* Renamed `ProjectGuid` to `ProjectId` and no longer hash target framework names on `ProjectConfigurationMessage` (PR: [#1454](https://github.com/OmniSharp/omnisharp-roslyn/pull/1454))
Expand Down
2 changes: 1 addition & 1 deletion build/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<MSBuildPackageVersion>16.0.461</MSBuildPackageVersion>
<NuGetPackageVersion>5.0.0-rtm.5856</NuGetPackageVersion>
<NuGetPackageVersion>5.0.0</NuGetPackageVersion>
<RoslynPackageVersion>3.1.0-beta2-19205-01</RoslynPackageVersion>
<XunitPackageVersion>2.4.0</XunitPackageVersion>
</PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/OmniSharp.MSBuild/ProjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,6 @@ private void AddProject(ProjectFileInfo projectFileInfo)
{
_logger.LogInformation($"Adding project '{projectFileInfo.FilePath}'");

_logger.LogDebug(JObject.FromObject(projectFileInfo).ToString());

_projectFiles.Add(projectFileInfo);

var projectInfo = projectFileInfo.CreateProjectInfo(_assemblyLoader);
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace test_wildcard
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>test_wildcard</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.*" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,21 @@ public async Task AntlrGeneratedFiles()
Assert.Contains(project.SourceFiles, fileName => fileName.EndsWith("GrammarParser.cs"));
}
}

[Fact]
public async Task ProjectWithWildcardPackageReference()
{
using (var testProject = await TestAssets.Instance.GetTestProjectAsync("ProjectWithWildcardPackageReference"))
using (var host = CreateMSBuildTestHost(testProject.Directory))
{
var workspaceInfo = await host.RequestMSBuildWorkspaceInfoAsync();

Assert.NotNull(workspaceInfo.Projects);
var project = Assert.Single(workspaceInfo.Projects);

Assert.Equal("ProjectWithWildcardPackageReference.csproj", Path.GetFileName(project.Path));
Assert.Equal(3, project.SourceFiles.Count);
}
}
}
}

0 comments on commit 77a01df

Please sign in to comment.