Nswag: Release version of .NET Core 2.1 is incompatible - "Specified framework not found [...] version '2.1.0-preview1-26216-03"

Created on 1 Jun 2018  路  9Comments  路  Source: RicoSuter/NSwag

I upgraded my project to the freshly released .NET Core 2.1. But it seems that nswag is looking for a preview version (which I don't have installed) and fails because it doesn't recognize the release version as compatible.

Probably rebuilding with the release version would solve this issue.

> nswag run /runtime:NetCore21

It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0-preview1-26216-03' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      2.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
high NSwag.Commands bug

All 9 comments

Yes, it's currently compiled against a preview version of .NET Core 2.1

Since I couldn't find a download anymore for the preview version, my workaround for now is to simply duplicate the 2.1 folder in C:\Program Files\dotnet\shared\Microsoft.NETCore.App and rename it to 2.1.0-preview1-26216-03.

This will work just fine until a new version is released.

I'm wondering where this 2.1.0-preview1-26216-03 is stored... in my projects I only specified netcoreapp2.1... is this compiled into the dll when compiling with a preview version?

Let's see if the CI build works against the latest SDK version: https://ci.appveyor.com/project/rsuter/nswag-25x6o/build/3155

@RSuter I also didn't expect this behavior, but it seems like it's compiled into the dll. I guess running 2.0 on 2.1 would be less of a problem, but version detection with preview releases is often a bit funky.

CI is not working anymore whereas it worked with the 2.1 preview... oh well...

I have similar issue on my projects and I fix it with global.json

{
  "sdk": {
   "version": "2.1.300"
  }
}

global.json did not work for us, how can we redirect version for nswag for now?

Was this page helpful?
0 / 5 - 0 ratings