Setup a basic solution with a project
Getting Ready
I assume you have VSCode && .Net installed by now. Open VSCode in the directoy of your choice. The directoy you choose is our Solution directory which will contain all our projects.
Your Explorer in VSCode should look like this:
In VSCode use
Ctrl + Shift + P
and type
Create new Integrated Terminal
till you can select that option. if you click on it a new terminal will open within VSCode.
In my case the git bash on windows is opened
Create a Solution
Let’s first create a empty solution:
In my case i choose “/d/Projects/Game” as directory for my solution. Check that the newly opened terminal uses the directoy you chose as solution directory. if not change the path with help of the command:
1 | cd <path to you solution dir> |
After checking and perhaps adjusting the directory type the following command to create new solution:
1 | dotnet new sln |
Your Explorer in VSCode should look like this afterwards
The directory’s name is the name of your solution.
Create a Project
If done successully create a console application with the following command:
1 | dotnet new console -n "App" |
This creates new console based application and should result in the follwing output in the Explorer
When done you need to add the newly created project to your solution. this is done via the following command:
1 | dotnet sln add App/App.csproj |
Build the Solution && Run the project
After that you can use
1 | dotnet build #builds all projects which where added to the solution |
to test your work. if everything works you should see a HelloWorld on your terminal:
Summary
With the five dotnet instruction we have created a simple Hello World solution. which is the starting point of our PluginSystem development.
1 | dotnet new sln # Creates a new solution with the containing foldername as solution name |
External Resources
Setup a basic solution with a project
http://johanneslueke.eu/2021/01/04/Setup-a-basic-solution-with-a-project/