✅ What is a "solution" in C#? How does it differ from a "project" ?
A solution in C# is just our project root folder where we can send organised code in that particular folder?
11 Replies
Solution groups multiple projects together
Defines some build configurations
The usual structure is something like
oh ok, why is it important ?
I mean why not used only the project names like MyCoolProject or MyCollProject.Tests
There are a lot of times when you might want to group multiple projects into the same overall project. For instance, if you're writing a calculator, you might want one project which contains all your logic and classes, one project which is a console application which uses the logic and classes, and one project which contains unit tests for your logic.
yep I see
thanks !
Unknown User•2d ago
Message Not Public
Sign In & Join Server To View
I tried to visualize what you mean, like for a game, we can have a UI or console app? But why would we want to have all the code in the same IDE and have their own set of dependency and same debug experience pls... I'm still new to programming, so I didn't build big projects yet :c
Unknown User•2d ago
Message Not Public
Sign In & Join Server To View
Since you gave the example of a game...
You can have
Game
project, Game.Server
project, and Game.Shared
project all in the same solution
Both the game and the server, for example, need to know what PlayerStats
are
That can go into Shared
And be used by both the game and the server projects
Without a solution, you would have to reference that Shared
project with its path, or you'd have to package it and install as a nuget package, or what have you
But since all three are in a solution, it's easy to reference one project from another
Because they share the same rootIf you have no further questions, please use /close to mark the forum thread as answered