.Net框架应用程序中的"startup.cs"(.Net Core)等效项是什么?

编程入门 行业动态 更新时间:2024-10-26 10:32:08
本文介绍了.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)等效项是什么?

本文发布于:2023-11-13 23:41:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585628.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   框架   Net   quot   Core

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!