Could not load file or assembly 'System, Version='

Jan 29, 2010 at 7:16 PM

Hi all,

I found the answer to my question, which was why am I getting the error above.  Here is the complete error.

"Could not load file or assembly 'System, Version=, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified."

I got this error when going through the HOL 2nd lab but not the 1st lab.  It happens no matter what version of VS I have, either VS2005 or VS2008.

It seems that the Unity Application block is looking for the wrong PublicKeyToken (see above).  The one I have for my System dll version 2.0 is PublicKeyToken=b77a5c561934e089.  I do believe that mine is the current one for version 2.0 of the .Net Framework.

If I use the GAC'd Unity out of the box I get the error.  However, if I reference the one that I have just built from the source on this site then no problem.

Is there a reason why the GAC'd Unity has the wrong version of the .Net Framework?


Jan 30, 2010 at 9:40 PM

Where did you get a GAC'ed copy of Unity? Did the Hands-on lab install it? I don't remember doing that. The default installer for Unity doesn't install anything in the GAC either.

There never was a public version of System with version that I know of - that's pretty weird. Unless Maybe somehow the Silverlight version got GAC'ed instead (but I don't think that could happen?)

It sounds like you've got a bad binary in the GAC. If you have any idea where it came from I'd love to know; if it came from one of our releases we obviously need to fix it.





Jan 31, 2010 at 6:20 AM

That the runtime version of System and it is the standard one that everybody uses - Runtime Version v2.0.50727, public version, sorry for the confusion. 

I did some digging around and yes I feel just a bit lame right now.  Turns out you were right it was grabbing the Silverlight version of the Microsoft.Practices.Unity but the correct version of Microsoft.Practices.ObjectBuilder2 and there is no GAC'd version whatsoever anywhere.

Sorry my bad.


Jan 31, 2010 at 8:05 PM

I think you've just put this bug: Rename Unity Silverlight Assembly, over the top. Definately changing the name for the next release to avoid this kind of thing.

Glad you figured it out!