Create C# .sln file with Visual Studio Code

deeptowncitizen picture deeptowncitizen · Mar 31, 2016 · Viewed 23.5k times · Source

I'd like to create a new C# solution with Visual Studio Code.

I'm using yo tools.

Now I have a folder with ASP project. And another folder with class library.

How can I reference class library from asp project?

Seems I have to add dependency to the project.json:

"dependencies": {
    "ClassLibrar.Name": "*"
}

But to make this possible I need solution file. But VS Code and yo doesn't create a such one.

UPD VS Code can be used from different OS, while VS accessible only from Windows, I'd like o create a new solution with VS Code only.

Simple requirement: create web project and 1+ class libraries.

All this will be packed in docker container

Answer

Mark Macneil Bikeio picture Mark Macneil Bikeio · Aug 27, 2017

Visual Studio Code provides a way to create the new project templates.

  1. Navigate to visual studio code terminal ( press Ctrl + `)
  2. Type the command dotnet new sln
  3. You can also create the new project, check list of available project templates using command dotnet new -l

The detailed documentation is Available Here.

enter image description here