Vs Code 创建 .Net 项目

 

Vs Code打开终端窗口

 

在“终端”中输入以下命令创建项目:

dotnet new console –framework net8.0 –use-program-main

 

终端默认是不可输入的

在 launch.json 中将 console 设置从 internalConsole 更改为 integratedTerminal

终端就可以输入了

 

 

在“终端”中输入以下命令创建解决方案:

dotnet new sln

 

向解决方案添加库项目:

dotnet sln add HelloWorld.csproj

 

在“终端”中输入以下命令创建库项目:

dotnet new classlib -o StringLibrary

 

添加项目引用到 HelloWorld

dotnet add HelloWorld.csproj reference StringLibrary/StringLibrary.csproj

 

添加 Nuget 包

dotnet add package Newtonsoft.Json

 

发布项目

dotnet run –configuration Release

发布项目到文件夹

dotnet publish -c Release -o ./bin/publish

来源链接:https://www.cnblogs.com/Zero-FeiYu/p/18386238

© 版权声明
THE END
支持一下吧
点赞6 分享
评论 抢沙发
头像
请文明发言!
提交
头像

昵称

取消
昵称表情代码快捷回复

    暂无评论内容