![how to create nuget package in visual studio 2019 how to create nuget package in visual studio 2019](https://devblogs.microsoft.com/visualstudio/wp-content/uploads/sites/4/2019/11/vsmac-pack-768x421.png)
- HOW TO CREATE NUGET PACKAGE IN VISUAL STUDIO 2019 HOW TO
- HOW TO CREATE NUGET PACKAGE IN VISUAL STUDIO 2019 CODE
HOW TO CREATE NUGET PACKAGE IN VISUAL STUDIO 2019 CODE
no, still no code for you! Well, apparently.
![how to create nuget package in visual studio 2019 how to create nuget package in visual studio 2019](https://windows-cdn.softpedia.com/screenshots/Microsoft-Visual-Studio_6.png)
Now move on with the wizard: you'll see Visual Studio installing some NuGet packages for you: You can also define a namespace for the generated code. Now, click on Add under the OpenAPI section.įinally, you can add a new API reference by specifying the location of the OpenAPI, both on your local machine or online. Here you can add references to OpenAPIs, gRPC, and other external services. Once created, in the Solution Explorer, right-click on the project, then click on Add > Service Reference For the following tests I used a simple Console Application I called MarvelMoviesClient. You can find the link in the UI, right below the title.ĭownload it or copy the URL, we're going to use it in a while. This time we won't use the UI, but only the JSON definition of the endpoints. Now, restore the NuGet packages and run the project: you'll be able to see the Swagger UI. I'm going to use the MarvelMovies project I used for both the Swagger and the HttpRepl articles: you can download it from GitHub. In this article, I'm going to explain how you can use the OpenAPI file to automatically generate code with Visual Studio 2019 so that you can use the boilerplate code instead of writing your own client. It's interesting for discovering the possible operations, but not really that useful for real integration with a project. We've also seen that you can use the OpenAPI file to navigate the APIs via the CLI with HttpRepl as if they were folders within a file system. the return value, with type and reference to the schema of the returned object.the parameters (if present) with name, type, and description.
![how to create nuget package in visual studio 2019 how to create nuget package in visual studio 2019](https://i.ytimg.com/vi/2r4eTq-AexQ/maxresdefault.jpg)
The general shape of this file is this one:Īs you see, for every endpoint (in this case I've shown only one) this file describes Everything works thanks to an OpenAPI file generated by Swagger, which will be used by the UI to describe your endpoints.
HOW TO CREATE NUGET PACKAGE IN VISUAL STUDIO 2019 HOW TO
We've already seen how to document your APIs with Swagger: include some NuGet packages to your project, define some settings on your Startup class and voilà, you have a handy UI for discovering the endpoints and for testing your APIs.