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 #2124

Closed
timjroberts opened this issue Mar 19, 2018 · 5 comments
Closed

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

timjroberts opened this issue Mar 19, 2018 · 5 comments

Comments

@timjroberts
Copy link

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.

@DustinCampbell
Copy link
Member

This issue was moved to OmniSharp/omnisharp-roslyn#1138

@DustinCampbell
Copy link
Member

Thanks for reporting this. I've moved the issue to the omnisharp-roslyn repo, since it's more about OmniSharp than C# for VS Code. It will be a bit before this feature makes it's way into OmniSharp. However, you may be able to get it to work by installing the latest Mono MDK (http://www.mono-project.com/download/) if the new MSBuild feature has made its way into Mono. C# for VS Code will use the installed Mono MSBuild if it's present.

@timjroberts
Copy link
Author

Thanks @DustinCampbell. I'll update the MDK and see if that flies too.

@timjroberts
Copy link
Author

Installing Mono 5.10.0 resolves the issue. The solution and projects load as expected and code-lens/autocompletion support works as normal.

Wished I had tried that first.

@DustinCampbell
Copy link
Member

Glad to hear it!

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

No branches or pull requests

2 participants