John Rose
John Rose

Reputation: 1973

ASP.NET 2.0 "BC2017: could not find library" - How to force .NET to look for correct version?

A precompiled ASP.NET 2.0 (Visual Studio 2005) application is throwing this error when we try to access it.

Compiler Error Message: BC2017: could not find library 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll'

Two immediate problems spring to mind:

  1. We're running .NET version 2.0.50727, not 2.0.0.0
  2. Our GAC is located at "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files," not "C:\WINDOWS\assembly\GAC_MSIL\"

So obviously it's looking for an outdated version of the assembly and it's looking for it in the wrong place.

Unfortunately, we can't recompile the application because we're hosting it for a client and the source code can't be obtained from the original developer. Is there any way to force the ASP.NET application to use the current version of System.Web.Mobile.dll and whatever other standard .NET assemblies it needs?

We will of course lecture them the perils of paying developers and not getting the source code, but we'd sure like to help them get this thing running until they can replace it.

Edit: It turns out that the problem was due to some disk corruption that affected the GAC. Now we're having some other .NET problems related to rebuilding the GAC, but that's another story. Closing this question.

Upvotes: 2

Views: 12673

Answers (3)

bendecko
bendecko

Reputation: 2793

I had some classes that appeared to have been included in the project, but turns out they weren't. Removed/Added back in, and now it builds, the class library DLL exists for the other projects and error gone.

Upvotes: 0

Jas
Jas

Reputation: 21

Change the mode to release > build the solution > change to debug > build solution again.

Upvotes: 2

Ian Jacobs
Ian Jacobs

Reputation: 5501

If you put the DLL's it's looking for in the same folder as the application itself, it should look there first before falling back to the versions in the GAC

EDIT: Just discovered http://www.dll-files.com/. You can check to see id they have the correct version of your DLL

Upvotes: 2

Related Questions