首页 > 其他分享 >Vs Code 创建 .Net 项目

Vs Code 创建 .Net 项目

时间:2024-08-29 11:49:52浏览次数:7  
标签:Code csproj HelloWorld add Vs 终端 dotnet new 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

标签:Code,csproj,HelloWorld,add,Vs,终端,dotnet,new,Net
From: https://www.cnblogs.com/Zero-FeiYu/p/18386238

相关文章

  • DCN V2 Improved Deep & Cross Network and Practical Lessons for Web-scale Learnin
    目录概DCN-v2WangR.,ShivannaR.,ChengD.Z.,JainS.,LinD.,HongL.andChiE.D.DCNV2:Improveddeep&crossnetworkandpracticallessonsforweb-scalelearningtoranksystems,2020.概DCN的升级版.DCN-v2DCN-v2的cross/deep的结合方式上有上......
  • 豆包MarsCode送京东e卡了!!!
    ​​​​​​豆包MarsCode——智能编码,一触即发链接入口如上:↑↑↑豆包MarsCode编程助手是豆包旗下的AI编程助手,提供以智能代码补全为代表的AI功能。本教程以在 VisualStudioCode 中为例,适用于在macOS、Windows和Linux的VisualStudioCode中安装豆包Mars......
  • ASP.NET WebApi + Autofac 实现依赖注入
    方法11.1、项目情况框架:.NETFramework4.5Autofac3.5.0Autofac.WebApi24.3.0 1.2、定义接口与对应实现//接口1publicinterfaceIBaseUserService{List<BaseUser>GetBaseUserList();}//接口2publicinterfaceIBaseCloseLoopService{List<BaseCloseLoop>GetBase......
  • net core自定义 Configuration Provider
    创建CustomConfigurationProvider首先,我们需要创建一个自定义的ConfigurationSource和ConfigurationProvider来支持配置文件的读取和监控。publicclassCustomConfigurationSource:IConfigurationSource{publicstringFilePath{get;}publicCustomConfig......
  • No module named 'mininet.cli'报错处理
    Nomodulenamed'mininet.cli'报错处理问题描述在命令行中输入python,在解释器中执行frommininet.cliimportCLI不会报错的前提下,使用makerun编译运行程序时,出现如下报错:Traceback(mostrecentcalllast):File"../../utils/run_exercise.py",line29,in<module>......
  • Codeforces Round 966 (Div. 3)
    A.PrimaryTaskif-else语句练习,判断前两个字符是否为"10",并判断之后的字符是否大于1点击查看代码#include<bits/stdc++.h>usingnamespacestd;#definelllonglong#defineullunsignedlonglong#definepiipair<int,int>intread(){intx=0,f=0;ch......
  • 一起学习LeetCode热题100道(61/100)
    61.分割回文串(学习)给你一个字符串s,请你将s分割成一些子串,使每个子串都是回文串。返回s所有可能的分割方案。示例1:输入:s=“aab”输出:[[“a”,“a”,“b”],[“aa”,“b”]]示例2:输入:s=“a”输出:[[“a”]]提示:1<=s.length<=16s仅由小写英文字母......
  • Android经典实战之存储方案对比:SharedPreferences vs MMKV vs DataStore
    本文首发于公众号“AntDream”,欢迎微信搜索“AntDream”或扫描文章底部二维码关注,和我一起每天进步一点点在Android开发中,键值对存储(Key-ValueStorage)是一种经常用到的轻量级数据存储方案。它主要用于保存一些简单的配置数据或状态信息,例如用户设置、缓存数据等。常......
  • Mono 现状与未来:从Wine-mono 到.NET 9
    Mono官网主页[1]和MonoGitHub页面今日发布公告[2],微软宣布将Mono项目移交给WineHQ组织,也就是Linux兼容Windows应用框架Wine的开发团队。微软从2014年开始向.NET开源发展,当时微软宣布.NETCore即将开源[3]。然而,在此之前,.NET就已经有了一个名为Mono的开源计划......
  • [1052] Add the ArcPy Python interpreter in VS Code
    ToaddtheArcPyPythoninterpreterinVisualStudioCode(VSCode),followthesesteps:InstallArcGISPro:EnsureyouhaveArcGISProinstalled,asitincludestheArcPylibrary.InstallVSCode:DownloadandinstallVisualStudioCodefromtheoffi......