Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to load the metadata for assembly

I'm having a problem with a project in Visual Studio 2010 after moving to a new corporate issued Windows 7 machine (from an aging XP machine).

I copied my projects across to the new machine, but Visual Studio seems to be having problems loading the WPF designer. I have a solution that includes several projects, it builds fine and runs fine, but when I try to open a WPF window in the designer, I get a whole bunch of error messages along the lines of:

"unable to load the metadata for assembly 'Foo'. This assembly may have been 
downloaded from the web.  See http://go.microsoft.com/fwlink/?LinkId=179545.  
The following error was encountered during load: Could not load file or assembly
'Foo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its 
dependencies. The system cannot find the file specified."

(Note the link in the error message seems to be no use whatsoever)

I think the problem here is that my corporate IT people have set up Windows 7 machines such that "My Documents" is actually a network drive that is cached locally. This is not a bad thing, because now all my files are backed up whenever I'm on the corporate network, but I think it's upsetting Visual Studio.

Is there a solution to this that doesn't involve abandoning the synched network drive (which I like) and copying everything to the local hard drive (which puts backups back on me).

like image 351
Matt Burland Avatar asked Dec 06 '25 18:12

Matt Burland


2 Answers

The solution found here on stackoverflow:

Unable to view designer in VS2010 due to DLL over the network

This seems to work for some people

"Open devenv.exe.config (in C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE on my machine), and add this"

<runtime>
    <loadFromRemoteSources enabled="true" />
</runtime>

worked for me. Same problem working in corporate environment, instead of on my own machine.

like image 127
TomMc Avatar answered Dec 08 '25 11:12

TomMc


Check if you some reference to dll installed on the local drive of the old XP machine. E.g. reference to a dll installed only on the GAC of the old machine!!

The process of locating and binding to an assembly is described here:

http://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.100).aspx

I suggest you:

  1. To check GAC (but your comment seems to discard this)
  2. To look for Codebase tags in configuration files
  3. To read this http://msdn.microsoft.com/en-us/library/15hyw9x3.aspx
like image 27
iSamnium Avatar answered Dec 08 '25 13:12

iSamnium



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!