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

Fails to load a project that uses an additional SDK reference #1138

Open
DustinCampbell opened this issue Mar 19, 2018 · 5 comments
Open

Fails to load a project that uses an additional SDK reference #1138

DustinCampbell opened this issue Mar 19, 2018 · 5 comments
Labels

Comments

@DustinCampbell
Copy link
Contributor

From @timjroberts on March 19, 2018 20:21

The extension fails to load .csproj files where additional SDKs have been specified as per the MSBUILD 15.6 "Sdk" Design concept.

Environment data

dotnet --info output:

.NET Command Line Tools (2.1.300-preview1-008174)

Product Information:
 Version:            2.1.300-preview1-008174
 Commit SHA-1 hash:  b8df89a54f

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.300-preview1-008174/

Microsoft .NET Core Shared Framework Host

  Version  : 2.1.0-preview1-26216-03
  Build    : f2c3216183d20416568a4bbf5bb7d153e826f153

VS Code version: 1.21.1
C# Extension version: 1.14.0

Steps to reproduce

Create a .csproj file that references an additional SDK. In my particular example, I have:

<Project Sdk="Microsoft.NET.Sdk;TypeScript.Sdk">
    ....
</Project>

In this example, TypeScript.Sdk has been manually installed into the SDK base path (identified in the dotnet --info output above), however, I've also tried using TypeScript.Sdk/1.0.0 which should prompt the NuGet resolver in MSBUILD to download and make the SDK available.

Expected behavior

The project should load successfully and code-lens/autocompletion support work as normal.

Actual behavior

I receive the following output in the Output window:

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/timroberts/test3/Core/Core.csproj
Can't find custom attr constructor image: /usr/local/share/dotnet/sdk/2.1.300-preview1-008174/Sdks/TypeScript.Sdk/lib/netstandard2.0/TypeScript.Sdk.Tasks.dll mtoken: 0x0a00000a due to: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. assembly:netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 type:<unknown type> member:<none>

At that point I receive no code-lens or autocompletion support for any project in the solution.

Running dotnet build works as expected, and the SDKs are executed as intended.

Copied from original issue: dotnet/vscode-csharp#2124

@DustinCampbell
Copy link
Contributor Author

FWIW, there is often a lag between when a feature appears in a nightly preview of the .NET Core SDK and when it appears in OmniSharp.

@natemcmaster
Copy link
Contributor

By the way, additional SDKs is supported in VS 15.6 and the 2.1.105 SDK. This isn't a preview feature anymore.

@DustinCampbell
Copy link
Contributor Author

Sure. I understand. However, as OmniSharp is a community project, it necessarily lags a bit. If you're interested in seeing it updated at a faster rate, do feel free to pitch in with PRs! 😄

@natemcmaster
Copy link
Contributor

Sorry if my last comment seemed whiny. I was just trying to point out that it affects users on stable releases, not just previews.

Would be happy to contribute more as time allows. I've hunting through the code and trying to figure out why this happens. I haven't found the cause yet.

@DustinCampbell
Copy link
Contributor Author

I did find the cause. It's due to a hack we left in OmniSharp due to the SDK resolvers not being able to support .NET Core SDKs <= 1.0.3. I'm removing the hack. 😄

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

No branches or pull requests

2 participants