vscode-csharp: Failure with .NET Core 2.0.0-preview2 SDK

From @cesarbs on May 18, 2017 17:18

Got this in VS Code with the latest pre-release version of the C# extension (1.10.0-beta3):

[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        The "ResolvePackageDependencies" task failed unexpectedly.
This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER.
System.TypeLoadException: Could not resolve type with token 01000040
  at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.GetPackageAndFileDependencies (NuGet.ProjectModel.LockFileTarget target) [0x0011f] in <9445a2665fcc4f009bbfa9fcd34c78f9>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.RaiseLockFileTargets () [0x000a6] in <9445a2665fcc4f009bbfa9fcd34c78f9>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.ExecuteCore () [0x00006] in <9445a2665fcc4f009bbfa9fcd34c78f9>:0 
  at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x00000] in <9445a2665fcc4f009bbfa9fcd34c78f9>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x0002a] in <6a1392588f4a45bdbe07807130f9b3d0>:0 
  at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x002bf] in <6a1392588f4a45bdbe07807130f9b3d0>:0 
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/Users/Cesar/src/aspnet/KestrelHttpServer/src/Microsoft.AspNetCore.Server.Kestrel.Core/Microsoft.AspNetCore.Server.Kestrel.Core.csproj'.
/Users/Cesar/src/aspnet/KestrelHttpServer/src/Microsoft.AspNetCore.Server.Kestrel.Core/Microsoft.AspNetCore.Server.Kestrel.Core.csproj

Happens on every project in Kestrel.

dotnet info:

$ dotnet --info
.NET Command Line Tools (2.0.0-preview2-006082)

Product Information:
 Version:            2.0.0-preview2-006082
 Commit SHA-1 hash:  6453cb4e15

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /Users/Cesar/.dotnet/sdk/2.0.0-preview2-006082/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview2-25309-07
  Build    : 41f5fc94eedc889f086800c23f35bf14a8c75a9f

Copied from original issue: dotnet/sdk#1229

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 106 (66 by maintainers)

Most upvoted comments

Preview 2 builds are not yet supported. These are still bleeding edge nightly builds which need work to properly support. I plan on looking at this in the coming week.

JFYI to those watching that I’ve gotten a super-hot Mono runtime that demonstrates .NET Core 2.0-preview2 builds working on OSX. A new Mono runtime is needed that adds an --assembly-loader=script flag to replicate desktop CLR SxS assembly loading behavior.

We need Preview 2 support on Windows ttt 😦

I’ve just pushed the v1.11.0-beta3 release which includes updated Mono 5.2 bits from the alpha channel. This should fix .NET Core 2.0 support on OSX/Linux. Please try the beta out! You can download it from v1.11.0-beta3. Follow the instructions in Installing Beta Releases to install.

FYI: I just put up a new beta release of C# for VS Code that actually fixes this issue on OSX/Linux. 😄

The latest beta fixes the problem on Windows. For OSX/Linux, the new Mono bits dropped on the alpha channel a little while ago and I’ll be taking them soon. Once that happens, I’ll push another beta that enables OSX/Linux.

OK. v1.11.0-beta2 is released. Follow the steps at Installing Beta Releases to get it.

Got it. I’m going to try to get a beta released today that at least fixes this for Windows. I’m still awaiting the latest Mono bits from Xamarin to address OSX/Linux.

@nguerrera: I just chatted with @marek-safar and he let me know about the upcoming mono –assembly-loader flag, which may be what I want to get the same assembly loading behavior on Mono as the .NET Framework. It’s in Mono alpha channel builds now.

(This isn’t confusing at all)

Or your could, you know, stop making breaking changes every release.

@DustinCampbell It is. And if it were v5, you’d still be in the same world of hurt, which is what I keep telling semver fanboys.

@emgarten: Isn’t that a semver breaking change?