C
C#2y ago
Kr1pt1c

csproj not found in Rider

Hi, I just started coding in C#, following an tutorial from CodeWithPraveen, I have created an main console programm as well as a subfolder with 4 different classes. I continued by using one class in my main console programm (after using dotnet add reference) but i get an "has missing dependencies" on the main csproj file aswell as an NU1105 error when trying to run the program. I tried some workarounds / fixes, that i found online but none of them helped so i hope someone can maybe help me thank you
13 Replies
Angius
Angius2y ago
How did you create this project?
Kr1pt1c
Kr1pt1cOP2y ago
file -> new solution -> console application
Kr1pt1c
Kr1pt1cOP2y ago
the selected one, do i have to use another one?
Angius
Angius2y ago
No, this seems fine
Kr1pt1c
Kr1pt1cOP2y ago
this is the entire error, weird thing is that i cant see the second csproj file from the subfolder in the rider structure preview
Angius
Angius2y ago
You have multiple .csproj files? In the same directory?
Kr1pt1c
Kr1pt1cOP2y ago
one in the main folder and one in an subfolder containing the classes
Angius
Angius2y ago
Ah, that's the issue You can't be nesting projects
Kr1pt1c
Kr1pt1cOP2y ago
Kr1pt1c
Kr1pt1cOP2y ago
should they be on the same layer?
Angius
Angius2y ago
MyCoolThing.sln
|— MyCoolThing.App
| |— MyCoolThing.App.csproj
| \— Program.cs
|— MyCoolThing.Models
| |— MyCoolThing.Models.csproj
| \— User.cs
MyCoolThing.sln
|— MyCoolThing.App
| |— MyCoolThing.App.csproj
| \— Program.cs
|— MyCoolThing.Models
| |— MyCoolThing.Models.csproj
| \— User.cs
That's the structure A solution can have multiple projects A project cannot have nested projects
Kr1pt1c
Kr1pt1cOP2y ago
oh ok i will test thx ❤️
Angius
Angius2y ago
When creating a new project with Rider, do not check the option to put the csproj on the solution level Then, if you want to add more projects, do it by right-clicking the solution in the solution explorer, then Add
Want results from more Discord servers?
Add your server