Nswag: .NET Core 3.1 Support

Created on 4 Dec 2019  路  15Comments  路  Source: RicoSuter/NSwag

As I'm sure you're aware, and can read about here, .NET Core 3.1 is now out, sadly I'm getting issues when trying to build with the MSBuild package:

Executing file 'nswag.json' with variables 'Configuration=Debug,OutDir=bin\Debug\netcoreapp3.1\'... 2>System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. 2>File name: 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 2> at System.Reflection.RuntimeAssembly.GetExportedTypes() 2> at System.Reflection.Assembly.get_ExportedTypes() 2> at NSwag.Generation.WebApi.WebApiOpenApiDocumentGenerator.GetControllerClasses(Assembly assembly) in C:\projects\nswag\src\NSwag.Generation.WebApi\WebApiOpenApiDocumentGenerator.cs:line 39

Is there a workaround I can use or is this just a case of needing a new version of NSwag?

Most helpful comment

v13.2.0

All 15 comments

A new version is needed. It shouldn't be too hard. Check out PR #1799, which added support for .NET Core 2.1. Similar changes are needed.

I am stuck on a project atm because of this issue. I was going to test @ada3m0n666 's forked feature branch but I can't figure out how to build the project on macOS. Is there a way? I can help or at the very least test the WIP feature.

@aaroncoville you can get packages generated by my PR here. I change the version to 13.1.7 to easily update my packages.
https://wetransfer.com/downloads/76eea97a77153fc2116e1238e6fb2e5c20191210092624/e16365fa5bb5358af78868b65c0b7ee720191210092624/f4d481

We are our upgrade to .net Core 3.1 till this is resolved Any updates on this yet?

Thank you

Why does the commandline tool even have a dependency on a runtime? I want the generated client-code to target a certain framework, but don't want to care about a .NET runtime to run the cli tool itself. I'm now having trouble running the cli (that comes with an NPM-package) in my buildpipeline because of that.

@kwaazaar because the CLI loads the project/assembly and executes the document generator in it. Because the DLL is built against a specific runtime version, the CLI must be built with the same version (or a newer version).

Hi, is it possible to publish the nuget packages for .net core 3.1?

Hi,
Could you please plublish this package for .Net Core 3.1
Trying to revert to .Net Core 3.0 but Nswag.core 13.1.6 still reference NJsonSchema 10.0.28 and my T4 fail.
Si if you upgrade with a 13.1.7 number it will be wonderful ;)

Probably it will be v13.2

Yeah, I'm currently able to dev thanks to @ada3m0n666 sharing his build, but I can't publish right now. I'd love if you were to release this, as it's currently blocking anyone from using 3.1 and NSwag.

v13.2.0

I still can't change the runtime version to NetCore31 with the following command:
nswag run version /runtime:NetCore31. I get the error originally mentioned in this issue. Any suggestions on a different way to update the runtime version of nswag?

use $(NSwagExe_Core31) run instead

I understand what's going on now! I've updated this issue with my findings for anyone who might need the help:
https://github.com/RicoSuter/NSwag/issues/2492

Was this page helpful?
0 / 5 - 0 ratings