Closed khaninejad closed 5 years ago
+1
Issues here using NSwag MSBuild with .NET Core 2.2
It would be really great to not have to wait until final releases in future.
A lot of people are in development and using pre-release versions of .NET Core, and it really breaks the whole workflow when you need to use a pre-release version for whatever reason and something as vital as nswag isn't compatible.
I get an error when trying to run aspnetcore2swagger under 2.2 (RTM version):
System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Extensions.Configuration.IConfiguration' while attempting to activate 'Sample.AspNetCore21.Startup'.
As you can see this is your example startup project namespace here.
IConfiguration
My guess is this is simply that I am running against 2.2 but your nswag.msbuild
tool is running under 2.1 so the types don't match. Does this sound correct?
Or to put it another way - is there any way to get nswag running under 2.2 or do we need to wait for you to update it?
For now I can just download the json file from a URL and run that through nswag.exe. That seems to be working OK, and is now properly lowercasing my properties without having to use [JsonAttribute]
Just added a PR #1799 for .net core 2.2 support
If anyone can't wait for an stable release just grab the artifact: https://ci.appveyor.com/api/buildjobs/81m5o2qf4ie0pe4p/artifacts/src%2FNSwagStudio%2Fbin%2FNSwag.zip
This approach is not recommend, just a temporal workaround
Will release the new version today or tomorrow.
Thanks for the PR @MarcosMeli
Thanks to you @RSuter for your amazing work in NSwag, our apps architecture become super simplified thanks to your awesome work !! Thanks for all the tools that you created to cover all scenarios !!
Agreed, thank you @RSuter !
Hi, As you know Microsoft released .netcore 2.2 and we need NSwag to support this runtime.
Thanks in advance. Regards