views:

761

answers:

5

The issue was reported as a bug to the VS team here but was closed as not reproducible since the original poster didn't reply I guess. I added my validation to the case, but I still can't find a workaround to fix this.

Issue: Just started today, all references to any assembly outside of the solution fails to resolve, with "The referenced component 'SomeComponent' could not be found." when trying to build. This happens for both 3rd party components (all 15 or so of them) as well as all .NET Framework assemblies, basically anything that isn't another project in the same solution.

Trying to load some other solutions produced the same issue. Creating a new WinForms project worked without a problem however. (Scratch that, it worked before reinstalling VS, now that doesn't work either. Created new WinForms app as well as WPF app and the Designer can't load the assemblies either. Tried targetting 3.5 and 2.0 and no luck)

Things I've tried:

  • Repair Visual Studio installation
  • Rebooting computer
  • Started VS with /resetsettings flag
  • System Restore to 2 days ago when it was known to be working
  • Uninstalling VS and reinstalling
  • Fresh checkout from SVN

Does anyone have any experience with this and knows of a way to get this working again? My strongest Google-fu has failed me, so I'm asking here. Can mark community wiki if requested.

Update: Tried "Upgrading" Windows (to the same version) since I didn't see a repair option for Vista and still no go. Reinstalled everything that seemed relevant. So far looking like I'm just gonna have to backup and reformat I guess unless a solution comes up some time before tomorrow.

Update2: Already just backed up data and reformatted, so I'm no long able to verify any ideas I haven't tried yet, so I'll just leave the bounty to expire on it's own to top voted answer and as a reference to anyone else who may have this problem later

+3  A: 

Suggested next debug step: review Project Designer: References -> Reference Paths to verify that the paths to your system and third-party components appear correctly. (Watch out for things that can slip past the old Mark I Eyeball like drive letters.)

chaos
Reference Paths is empty
Davy8
Yeah, that might be bad. Try adding paths to where your components live (presumably starting with the current one reported, since that'll tell you whether it works in principle).
chaos
Still doesn't work. Deleted the references and re-added them. In the reference property the path isn't listed even though I added the reference to the dll file.
Davy8
You want to add a path to the directory containing the DLL, not the DLL itself; sorry, I didn't make that clear.
chaos
Right, under Reference Paths I added the path to the directory containing the DLLs (well 2 of them) it doesn't let you select anything other than a directory. I was referring to in addition to that I also tried re-adding the reference itself and that path isn't listed there either.
Davy8
Ah, gotcha. It sounds like something isn't right there, but I don't know what to tell you to do about it. Sorry.
chaos
Thanks though, +1 for trying
Davy8
+2  A: 

I hate to say it, but it sounds like the system is pretty borked. There has to be a point when it is quicker to reinstall the OS than it is to continue trying to fix the current install.

I just hope you take this in the right spirit... sorry.

Marc Gravell
-10! j/k yeah I figured as much and that's what I'm doing
Davy8
I wish you the best of luck, but I expect you'll end up doing an OS re-install. In which case: sooner = less time lost.
Marc Gravell
+3  A: 

Try running VS after turing on Assembly load logging with fuslogvw. You'll be able to see additional errors captured by the runtime when it tries to locate and load the assemblies.

In Vista, you'll have to run fuslogvw as an administrator and somtimes specify an explicit path to save the logs.

You can also try debugging Visual Studio by attaching to it from another instance, or with the basic debugger included with the .NET SDK.

Paul Alexander
Would attaching VS debugger to another instance work even though it's not crashing, just refusing to compile?
Davy8
Yep you'll see diagnostic info dumped to the Output window. Chances are there's some exception thrown deep down that gets swallowed and translated to something elese. Ctrl+Alt+E to bring up exceptions and turn them all on. That will get you the exception as soon as it happens.
Paul Alexander
A: 

Shot in the dark here, but I've run into the same (similar) problem. The issue I ran into was related to having a 64bit machine and running a project that had a mixture of 64bit and 32bit 3rd party dll's. The solution was to ensure I had the correct bits (32v64) and then to have the project build in 32 bit mode: project properties > build > platform target: x86.

Another time this occurred I had to remove all the 64bit dll's and reinstall with the 32bit dll's

HTH's

Metro Smurf
64-bit machine, but all dll's are 32-bit and solution is compiled x86
Davy8
A: 

Check your output with ILDASM to make sure the references are showing up correctly -- compare them to an assembly that works, and see if anything jumps out at you.

Coderer
Unless I'm misunderstanding how ILDASM work (I've never used it before) there is no assembly, it can't even start the compile process. They show up as compiler warnings not errors, but the build process won't start
Davy8
No, you're right -- I must have misread your post. I thought you were having *runtime* problems. Never mind.
Coderer