简体   繁体   中英

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

I am trying to look out for creating C# Project in Visual Studio Code with .csproj extension but unable to find anything relevant for the same. Please share the helpful with prerequisites for the same.

you can use Yeoman on Terminal (of VS Code or any terminal write):

 yo aspnet

then you choice what you need to create, I assume you have installed Core and 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)

If you want to create Web application choose it and press ENTER answer the name you wish (test_web my example) and then push 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

after to create the web application test_web you need execute:

cd test_web
dotnet restore
dotnet run

To run from VS Code, you only have to open the folder test_web. Debugger is recognize .Net projects then you only push F5 to run from VS Code.

To install yeoman if you dont have:

npm install -g yo bower

web reference

you need NodeJs to use yeoman and npm.

anyway you have option to use monoDevelop in Ubuntu.

I tested it and it is working on Ubuntu for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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