Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdk element in MSBuild project causes InvalidProjectFileException on load #904

Closed
natemcmaster opened this issue Jul 4, 2017 · 1 comment · Fixed by #907
Closed

Sdk element in MSBuild project causes InvalidProjectFileException on load #904

natemcmaster opened this issue Jul 4, 2017 · 1 comment · Fixed by #907
Assignees
Labels

Comments

@natemcmaster
Copy link
Contributor

OmniSharp cannot parse projects that use the <Sdk> element under project. (I believe this is new in MSBuild 15.3)

Repro

<Project>
  <Sdk Name="Microsoft.NET.Sdk" />
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>
</Project>

Error

Microsoft.Build.Exceptions.InvalidProjectFileException: The element <Sdk> beneath element <Project> is unrecognized.  /private/tmp/tst/tst.csproj
...

 at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00001] in <bdf083ca20c84af487947992fd9a4a29>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName) [0x00001] in <bdf083ca20c84af487947992fd9a4a29>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.LoadProject (System.String filePath, System.String solutionDirectory, System.String sdksPath, Microsoft.Extensions.Logging.ILogger logger, OmniSharp.Options.MSBuildOptions options, System.Collections.Generic.ICollection`1[T] diagnostics, System.Collections.Immutable.ImmutableArray`1[System.String]& targetFrameworks) [0x00062] in <4547000d373140b29fc6ad48137693ba>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create (System.String filePath, System.String solutionDirectory, System.String sdksPath, Microsoft.Extensions.Logging.ILogger logger, OmniSharp.Options.MSBuildOptions options, System.Collections.Generic.ICollection`1[T] diagnostics) [0x0000a] in <4547000d373140b29fc6ad48137693ba>:0 
  at OmniSharp.MSBuild.MSBuildProjectSystem.LoadProject (System.String projectFilePath) [0x0003f] in <4547000d373140b29fc6ad48137693ba>:0 

Details:
macOS Sierra
mono: not installed
dotnet: 2.0.0-preview2-006497
VS Code: 1.13.1
C# extension: 1.12.0-beta1

@DustinCampbell
Copy link
Contributor

Thanks @natemcmaster! I need to update OmniSharp's build of MSBuild to get this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants