.Net框架应用程序中的"startup.cs"(.Net Core)等效项是什么? [英] what is the equivalent of "startup.cs"(.Net Core) in my .Net framework application?
问题描述
Startup.cs
具有一些可用于配置swagger以添加文件上传功能的方法,现在我可以在.NET Framework中的哪个文件中执行相同的功能?
Startup.cs
has some methods which can be used to configure swagger to add file upload functionalities , now in which file in .NET Framework can i do the same functionalities?
推荐答案
正如您所说的,您想在dot net framework
中使用configure Swagger
,因此您需要install Swashbuckle
只需打开package manager
并输入以下commands
>
As you said you want to configure Swagger
in dot net framework
so you need to install Swashbuckle
just open package manager
and type following commands
Install-Package Swashbuckle -Version 5.6.0
然后在App_Start
文件中找到SwaggerConfig.cs
可以在其中进行配置
then look in your App_Start
file you will find SwaggerConfig.cs
where you can configure it
最低要求,您需要将此行添加到enable Swagger and Swagger UI
.
the minimum, you’ll need this line to enable Swagger and Swagger UI
.
GlobalConfiguration.Configuration
.EnableSwagger(c => c.SingleApiVersion("v1", "A title for your API"))
.EnableSwaggerUi();
这篇关于.Net框架应用程序中的"startup.cs"(.Net Core)等效项是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!