Swashbuckle aspnet core 2.0 Swaggerconfig.cs not created - asp.net-core

I'm trying to install Swashbuckle to my web api in aspnet core 2.0. Reading all over google about how to set it up it's written about the SwaggerConfig.cs under the App_Start-folder.
But when I install it never gets created?? Where is it?
All I can do is setting up the basics in Start.cs, and it's just some basics? Where is the SwaggerConfig.cs ?

There are two versions of swashbuckle:
https://github.com/domaindrivendev/Swashbuckle
https://github.com/domaindrivendev/Swashbuckle.AspNetCore
There is no SwaggerConfig file on the AspNetCore version.
Your configuration goes on the Startup.cs:
Swashbuckle.AspNetCore/blob/master/README.md#getting-started

Related

How can I connect to a SignalR hub using ASP.NET Core 2.1

I am trying to connect to SignalR hubs from an ASP.NET Core 2.1 project.
Looking at the documentation here: https://learn.microsoft.com/en-us/aspnet/core/signalr/dotnet-client?view=aspnetcore-2.2, it says a package reference to Microsoft.AspNetCore.SignalR.Client is required.
Looking at the NuGet site (https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client/) for this library, no versions for .NET Core 2.X are available.
How come there are no versions for 2.1 available? What library can I use for connecting to SignalR hubs using .NET Core 2.1, if not Microsoft.AspNetCore.SignalR.Client?
The SignalR version numbers are a bit confusing because SignalR was actually not available with ASP.NET Core 1.x but came later with 2.x. And it shipped on a separate lifecycle which you can also see by the versions of the Microsoft.AspNetCore.SignalR package. So basically, the numbers are just very out of sync with ASP.NET Core versions.
They are fixing that in ASP.NET Core 3, where SignalR and its clients will be regular parts of ASP.NET Core, shipping normally with the framework and sharing version numbers.
For 2.x this basically means that you just pick the latest SignalR 1.x. To verify the best version, you should also look at the dependencies of Microsoft.AspNetCore.SignalR.Core which is the base dependency for both the client as well as the server package. You will see that it also depends on Microsoft.AspNetCore.Authorization. So that should be your indicator which version to use for which version of ASP.NET Core.
To summarize:
For ASP.NET Core 2.1, use version 1.0.4 of the server package and the client package.
For ASP.NET Core 2.2, use version 1.1.0 of the server package and the client package.
For ASP.NET Core 3.0, the server part already ships with ASP.NET Core and for the client use a 3.0 version.
Actually, you will not face any issue using the latest SignalR stable package (#aspnet/signalr#1) with .net core 2.1. Please see the related doc for more info.

Could someone explain how to configure nhibernate5.1 in dotnet core 2.0 project

As nhibernate5.1 supports dotnet core2.0, we are trying to use nhibernate 5.1 in our dotnet core 2.0 api project. Don't find any documentation on how to configure nhibernate5.1 in dotnet core 2.0 project. Could someone guide me on the same.
NHibernate GitHub repository has a minimal web (not API) application example showing how to use it with .Net Core. See here.

How can I use webpack in .net core 2.0 by nuget?

I have learned asp.net yet.What's more I am also a beginner of .net core and webpack.Now I am tring to use webpack in .net core.
I downloaded the webpack by nuget like this:
But I don't konw how to continue to configure it.I tried to follow the tutorial as https://webpack.github.io/docs/tutorials/getting-started/
However,the tutorial is using nodejs.
I searched about "Setting up Webpack in ASP.NET Core" in google.Whereas,all of them are build by NPM,but not nuget.
I wonder if there is a way to build it by nuget?Would you like to teach me or give me a tutorial about this?Thank you.

Imageresizer and PrettyGifs in asp.net core

In previous versions of ASP.NET Core we used PrettyGifs plugin. In order to make it working we had to add in Web.config. But in asp.net core we don't have web.config anymore. So how can we use this plugin?
All plugins also offer code-based configuration/installation, like new PrettyGifs().Install(Config.Current);
That said, ImageResizer 4.X requires .NET Full for the moment. Imageflow will support .Net Core and is cross-platform.

Migrating Options to ASPNET Core RC2

I have a application built on ASPNET Core RC1, which is using string typed configuration Options, and I am trying to migrate to RC2.
But the following code is not working anymore:
services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));
According to ASPNET Core docs, it was supposed to converted this way:
services.Configure<AppSettings>(Configuration);
But this is also not working. The only overload available for the Configure extensions method accepts only a Action as parameter, and I don't want to have to parse the entire configuration myself.
What would be the right way to migrate this code?
Try adding Microsoft.Extensions.Options.ConfigurationExtensions package.