创建一个WebApi

cd 自己想要建项目的路径下
#创建webApi项目,-o后面是输出文件夹名称
dotnet new webapi -f net6.0 -o TestApi
#进入项目目录
cd TestApi
# 运行项目
dotnet run

#默认自带swagger http://localhost:port/swagger/index.html

 

创建一个控制台应用程序

D:\test>dotnet new console -o Sea
D:\test>cd Sea
D:\test\Sea>dotnet run
Hello World!

 

posted on 2025-01-09 16:41  lshan  阅读(6)  评论(0)    收藏  举报