繁体   English   中英

如何在Visual Studio Code中以.csproj扩展名创建C#项目?

[英]How to create C# project with .csproj extension in Visual Studio Code?

我正在尝试在扩展名为.csproj的Visual Studio Code中创建C#项目,但找不到与此相关的任何内容。 请与帮助分享前提条件。

您可以在VS Code或任何终端写入的终端上使用Yeoman:

 yo aspnet

然后选择您需要创建的内容,我假设您已经安装了Core和Yoeman:

What type of application do you want to create? (Use arrow keys)
❯ Empty Web Application 
  Empty Web Application (F#) 
  Console Application 
  Console Application (F#) 
  Web Application 
  Web Application Basic [without Membership and Authorization] 
  Web Application Basic [without Membership and Authorization] (F#) 
(Move up and down to reveal more choices)

如果要创建Web应用程序,请选择它,然后按Enter回答您想要的名称(test_web是我的示例),然后按Enter:

   create test_web/.gitignore
   create test_web/Program.fs
   create test_web/Startup.fs
   create test_web/test_web.fsproj
   create test_web/web.config
   create test_web/Properties/launchSettings.json
   create test_web/README.md
   create test_web/runtimeconfig.template.json
   create test_web/global.json

创建Web应用程序test_web之后,需要执行以下命令:

cd test_web
dotnet restore
dotnet run

要从VS Code运行,只需打开文件夹test_web。 调试器可以识别.Net项目,那么您只需按F5键即可从VS Code运行。

如果您没有安装yeoman,请执行以下操作:

npm install -g yo bower

网络参考

您需要NodeJ来使用yeoman和npm。

无论如何,您都可以选择在Ubuntu中使用monoDevelop。

我对其进行了测试,并且它可以在Ubuntu上运行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM