.Net框架应用程序中的"startup.cs"(.Net Core)等效项是什么? [英] what is the equivalent of "startup.cs"(.Net Core) in my .Net framework application?

查看:214
本文介绍了.Net框架应用程序中的"startup.cs"(.Net Core)等效项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆