posted on Wednesday, January 19, 2005 5:42 PM
by
roydictus
Visual Studio.Net ruined my day
Argh, today I ran into problems with Visual Studio.Net
2003, and they took me almost all day to solve. Sh** happens I guess.
First, I tried to compile on my system, but Visual
Studio.Net kept complaining that he couldn't open the Web project. I tried all
tricks that I could think of, including emptying the directory in C:\InetPub\wwwroot, and nothing worked. Then just to
make sure the problem was related to Visual SourceSafe -- the team I'm working
with is using this terrible source code control system, I'm afraid --, I cleaned
up all links with VSS and tried to open the Solution, and that worked. So VSS
was the culprit. For that problem at least.
I fixed the issues by:
- completely removing the source code from my hard
disk,
- clearing the Visual Studio.Net Web Cache,
- removing the Virtual Directory in
IIS, and
- opening the Solution using File / Source Control / Open
from Source Control.
Then I could open the Solution just fine and
compile...
Only to bump into Problem #2.
Whenever I built and ran the Web site, I got a "Parser
Error: Could not load type <xxx>".
Strange. Looked at the code, it was fine. Looked at the
reference in the ASPX file, it was fine.
Rebuilt. Same problem.
Cleaned the Web Cache again. Same problem.
Reset IIS. Yep, same thing.
Rebooted the darn-diddly-arn PC. No
change.
I once read that, after all else has failed, you should
read the manual. So I looked up this error on MSDN and
found that you "just have to build" the project... Which is exactly what I was
doing. To make sure, I opened the generated DLL with Reflector and surely, the code
was fine.
OK, so after rebuilding and cleaning caches and removing
bin and obj and so forth for about 20 times, I was ready to kill someone. I
strangled the first colleague who happened to enter my office, then I felt much
better and continued.
Finally, I:
- rebooted the PC,
- removed the virtual directory from IIS,
- removed all source code related to the project from the
hard disk,
- cleared the Web Cache,
- removed all temporary files from my PC with TuneUp
Utilities,
- cleaned up and defragmented my Registry with the same
utility suite,
- changed the Working Directory of the solution in Visual
SourceSafe to a new, fresh location,
- rebooted the PC again,
- opened Visual Studio.Net and did an "Open from Source
Control", and
- did a "Build Solution".
and it finally worked!
I still don't know what caused the Parser Error, but now I
know what I'll try first next time this happens...