Geeks With Blogs

Welcome to my blog.
Here's what we've got on the menu today:

Lorin Thwaits A geek says what?

The GAC in .NET 4.0 is cut into two parts now -- one half for .NET Framework 2.0 stuff, and the other for v4.0 stuff. When compiling any project, targeting .NET 2.0, 3.5, or what have you, this annoying error may pop up:

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

If you are working on a 32-bit system then open a run box and perform this copy command:

xcopy "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.EnterpriseServices.dll" %windir%\Microsoft.NET\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a

If you get a window popping up asking "(F = file, D = directory)?" then sure enough, this fix should work for you, and you should press "D".  If you instead get a message asking if you should overwrite, with "(Yes/No/All)?" then you already had the file in place, and this did not fix anything.

The goal here is to fully reconstruct the .NET 4.0 portion of the GAC for that one missing assembly.

Posted on Sunday, March 21, 2010 7:12 AM ASP.NET | Back to top

Comments on this post: .NET Framework 4.0 mysteriously loses track of System.EnterpriseServices

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Lorin Thwaits | Powered by: