簡體   English   中英

在我的.Net框架應用程序中,“startup.cs”(.Net Core)的等價物是什么?

[英]what is the equivalent of “startup.cs”(.Net Core) in my .Net framework application?

Startup.cs有一些方法可用於配置swagger來添加文件上傳功能,現在.NET Framework中的哪個文件可以執行相同的功能?

如你所說,你想在dot net framework configure Swagger所以你需要install Swashbuckle只需打開package manager並輸入以下commands

Install-Package Swashbuckle -Version 5.6.0

然后查看您的App_Start文件,您將找到SwaggerConfig.cs ,您可以在其中進行配置

在此輸入圖像描述

最低限度,你需要這一行來enable Swagger and Swagger UI

GlobalConfiguration.Configuration
  .EnableSwagger(c => c.SingleApiVersion("v1", "A title for your API"))
  .EnableSwaggerUi();

在這里查看很長的解釋

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM