C
C#ā€¢2y ago
Tim

C Sharp Monorepo

Hey guys šŸ‘‹ I want to create an Monorepo for my C# Backend and Frontend (Blazor). Any idea, how can I create such an Monorepo?
23 Replies
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Tim
Timā€¢2y ago
Like
my-app/
ā”œā”€ backend/
ā”‚ ā”œā”€ ....cs
ā”‚ ā”œā”€ backend.csproj
ā”œā”€ frontend/
ā”‚ ā”œā”€ ....cs
ā”‚ ā”œā”€ frontend.csproj
ā”œā”€ .gitignore
my-app/
ā”œā”€ backend/
ā”‚ ā”œā”€ ....cs
ā”‚ ā”œā”€ backend.csproj
ā”œā”€ frontend/
ā”‚ ā”œā”€ ....cs
ā”‚ ā”œā”€ frontend.csproj
ā”œā”€ .gitignore
?
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Tim
Timā€¢2y ago
Wdym by solution?
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Tim
Timā€¢2y ago
Ah yeah, I use VS Code So the solution is just the root folder?
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Tim
Timā€¢2y ago
For what is the .sln file?
Pobiega
Pobiegaā€¢2y ago
its how you handle multi-project "projects" in .NET
Angius
Angiusā€¢2y ago
MyCoolProject
|ā€” MyCoolProject.sln
|ā€” Backend
| |ā€” Backend.csproj
| \ā€” ...
|ā€” Frontend
| |ā€” Frontend.csproj
| \ā€” ...
|ā€” Shared
| |ā€” Shared.csproj
| \ā€” ...
\ā€” ...
MyCoolProject
|ā€” MyCoolProject.sln
|ā€” Backend
| |ā€” Backend.csproj
| \ā€” ...
|ā€” Frontend
| |ā€” Frontend.csproj
| \ā€” ...
|ā€” Shared
| |ā€” Shared.csproj
| \ā€” ...
\ā€” ...
Tim
Timā€¢2y ago
And how can I use the Shared thing there then?
MasterSubarashii
MasterSubarashiiā€¢2y ago
by giving reference?
Tim
Timā€¢2y ago
How?
Angius
Angiusā€¢2y ago
dotnet add reference command - .NET CLI
The dotnet add reference command provides a convenient option to add project to project references.
MasterSubarashii
MasterSubarashiiā€¢2y ago
does
using
using
work in VSCode?
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
MasterSubarashii
MasterSubarashiiā€¢2y ago
but you gotta reference it okay
Tim
Timā€¢2y ago
Thx Ahhh, is lib/ for this then? (https://gist.github.com/davidfowl/ed7564297c61fe9ab814) Or just do create the shared project in the src folder?
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Tim
Timā€¢2y ago
Ah I just didnt get it So just src/shared/?
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Tim
Timā€¢2y ago
šŸ‘