.NET and Visual Studio references issue...

Maximilian

Lifer
Feb 8, 2004
12,603
9
81
So i've started helping on a rather large .NET Webforms application. Its a bit old but not ancient, guy who originally wrote it is long gone. Anyway I have this problem where Visual Studio seems to "forget" a good chunk of references. Like it just can't find dependencies for some reason. The using statements at the top of classes, some of them have little red underlines despite the class existing and me being able to look at it.

The errors are typically like this:
"
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Provisioning' does not exist in the namespace 'MyProject.Namespace' (are you missing an assembly reference?) WebApplication
"

Quite often it's not the same thing though, it forgets different things sometimes. I have no fecking idea what triggers this either because it builds fine sometimes. Although every time this has happened it results in me having to get a fresh copy of the application from my data drive, because im completely unable to fix this.

I am using Visual Studio 2017. This application is pretty huge, it is made up of multiple projects and a webapplication bundled into a solution. The references it says are missing... I can see them, the classes are there! One of the senior devs mentioned that this application has circular dependencies. I don't know if that is relevant because I did try to fix this by removing and re-adding dependencies but it wouldn't let me due to it creating a "circular dependency". Makes me wonder how it ended up with circular dependencies in the first place but hey ho, I didn't write it.

Any idea's why it does this?

I have tried clean solution, rebuild solution. It still can't find a bunch of things that it did manage to find yesterday


tl;dr
Semi old and large webforms application loses its dependencies sometimes and becomes unbuildable. Once it does this I basically need a fresh copy because I have been unable to fix it when this happens. I think it has circular dependencies too. Any ideas how to make it build again?
 

Maximilian

Lifer
Feb 8, 2004
12,603
9
81
Okay I think i've solved this....

It was missing some .dll files. I mean it clearly had them yesterday so I don't know what happened between now and then that they disappeared but manually copying the missing .dll files I have (from my fresh working copy on my data drive) into the folders where Visual Studio was looking for them has fixed it for now.

~/ProjectMissingDlls/bin/Debug
Each project has a directory like that, I basically copied the .dll in there.
 

KB

Diamond Member
Nov 8, 1999
5,401
386
126
IIRC when you do a "Clean" it wipes out the files in the /bin/Debug directory. Visual Studio has been known to do that on its own even without a clean.
If you want to avoid this in the future, I would recommend against putting the needed DLLs in the bin/Debug folder.
Instead reference the project if the project is within your solution. If it is outside the solution put the DLL in a known location that doesn't get wiped or changed and always has the latest version.
 

Merad

Platinum Member
May 31, 2010
2,586
19
81
KB is correct. If it's feasible, I highly recommend investing the time to create nuget packages for your dependencies and hosting them with an internal nuget server. Trying to manually maintain dependencies is an absolute nightmare.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |