RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.77k stars 1.29k forks source link

Need .Netcore2.2 Support #1795

Closed khaninejad closed 5 years ago

khaninejad commented 5 years ago

Hi, As you know Microsoft released .netcore 2.2 and we need NSwag to support this runtime.

Thanks in advance. Regards

jim-strang commented 5 years ago

+1

Issues here using NSwag MSBuild with .NET Core 2.2

simeyla commented 5 years ago

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.

simeyla commented 5 years ago

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.

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]

MarcosMeli commented 5 years ago

Just added a PR #1799 for .net core 2.2 support

MarcosMeli commented 5 years ago

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

RicoSuter commented 5 years ago

Will release the new version today or tomorrow.

RicoSuter commented 5 years ago

Thanks for the PR @MarcosMeli

MarcosMeli commented 5 years ago

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 !!

jim-strang commented 5 years ago

Agreed, thank you @RSuter !