How to create a solution of .net core? For example: 1 Web Project 3 Lib Projects
How to create it without Visual Studio?
Using VS Code or Sublime Text?
If you have dotnet core installed just create a root folder for your solution. Then open terminal in root folder and type for a mvc project:
dotnet new mvc -o SolutionName.Web
remember -o parameter creates a folder for new project and if it was -n project was going to be created in the folder you are in.
and for class library project
dotnet new classlib -o SolutionName.Library
cd SolutionName.Web
this line to add reference to use this library.
dotnet add reference ../SolutionName.Library/SolutionName.Library.csproj
get to root folder again
cd..
dotnet new sln -n SolutionName
we talked about -n. After we created solution we will add projects to solution.
dotnet sln add SolutionName.Web/SolutionName.Web.csproj
dotnet sln add SolutionName.Library/SolutionName.Library.csproj
dotnet build
if you are using vs code just type
code .
in the root of solution in terminal and you will start coding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With