my shared projects are not found. how do I fix?
so as you can see it says my two other projects are not found but I can view them in my file explorer and open them just fine. I am assuming I just need to add them again but how? I tried doing a rebuild project but it only rebuilds one not all 3
20 Replies
I did move the folder too which I guess is not good
remove them from the solution then re add them
I did that and got a whole bunch of new errors now
Severity Code Description Project File Line Suppression State Details
Error CS0579 Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute FakeFlightBookingApp D:\Zeeshan\Documents\FakeFlightBookingApp\FakeFlightBookingAPI\obj\Debug\net8.0.NETCoreApp,Version=v8.0.AssemblyAttributes.cs 4 Active
Do you know how to hard clean your solution?
nope
project was working completely fine but I wanted to move those 2 folders somwehre else and now its all messed up
I was jus tthinking making a new priject and copy all the files over
It is fine to move or rename, but when you do so VS is lost because you did it outside the Ide. Are two projects reloaded now.
yup they are reloaded now but I cant seem to run the project as I just gives a bunch of errors
Ok, shut down VS. And go to your solution in your directory explorer
Goto the root directory where the .sln file is and delete the .vs folder only this folder.
Then goto each of the project folders where the .csproj files are and delete the obj and bin folders only these folders.
ok thx
Restart VS, right click the solution and do the sync namespaces.
When you restarted VS those folders are recreated (clean versions).
So any old stuff Vs was seeing is gone.
You still might need to do some cleanup.
And yes your thought of recreating is an option as well.
hey it works thx
I just need to move these folder now saffely
Sometimes vs is to dumb being to smart.
haha yh
You should remove them first make your changes then add them back and do the resync
yh thanks I will try th\t
just did that and followed your steps about removing vs folder and the obj and bin folder but gives a bunch of errors
Severity Code Description Project File Line Suppression State Details
Error CS0579 Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute FakeFlightBookingApp D:\Zeeshan\Documents\FakeFlightBookingApp\obj\Debug\net8.0-windows7.0.NETCoreApp,Version=v8.0.AssemblyAttributes.cs 4 Active
this is one of th 17
do you recoginise this error?
i think theres some duplications going on that messes it up
Open the .csproj file of the FakeFlightBookingApp project and ensure that there is only one <TargetFramework> tag defined.
I do and still getting an error
nvm
Curiosity did you get it fixed? If so is this correct?
I do not do much desktop dev.
Net8.0-windows7.0
I did get it fixed by keeping the projects in separate folders as it turns out its bad practice to place a project folder into another project folder
I asked this question in #help-0 and was told its bad practice
is placing a new project folder inside an already existing project folder bad practice?
I ask because I made a WPF project named FakeFLightBooking and I made an ASP.NetCore WEB API project named FakeFLightBookingAPI and I placed the ASP project in my FakeFLightBooking WPF project is that ok or considered as bad code practice?
this was one of the answers
"i certainly wouldn't recommend putting projects inside projects
multiple projects inside a solution, go for your life
you are "allowed" to nest projects inside other projects on disk if you want, but relative paths and project references can get weird with it sometimes so it's generally not recommended"
Think of it in this way.
Within a solution your managing projects (.csproj) files.
Wether you want to structure a folder system like you stated that is entirely your choice to do so. Yes not a common practice. The headache begins when you decide on moving or renaming these, folders in VS are namespaces. You have already discovered this. Overall it really depends on the architecture of the systems your building. Class libraries are compiled dll's so no relative path issues can arise, but if your combining api projects then yes they may, and you will have to deal with it. Common or bad practice, these days of development one has to decide what path they want follow.