You may receive a "vbc : Command line error BC2017 : could not find library" error message when you compile an application in Visual Basic .NET 2003 or in Visual Basic 2005

Article translations Article translations
Article ID: 897299 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

In Microsoft Visual Studio .NET 2003 or in Microsoft Visual Studio 2005, when you try to compile a Microsoft Visual Basic .NET or Microsoft Visual Basic 2005 application, you may receive an error message that is similar to the following:
vbc : Command line error BC2017 : could not find library 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\vbwebapp\093b8894\b238cf87\assembly\dl\c0d82e1f\043d'

vbc : Fatal error BC2000 : compiler initialization failed unexpectedly: The filename, directory name, or volume label syntax is incorrect.
Note In this error message, the word "filename" should be spelled "file name."

You may receive this compilation error message when you use a command prompt or the Visual Studio IDE to compile your code.

CAUSE

This issue occurs because a DLL that appears in the error message is not registered in the global assembly cache.

WORKAROUND

To work around this issue, register the DLL in the global assembly cache by using the following command:
gacutil -i DriveLetter:\YourPath\YourAssemblyName.dll

MORE INFORMATION

You may notice that the same error message is also documented in the following Microsoft Knowledge Base article:
319976 Visual Basic .NET compiler error when you use a response file that references many assemblies
However, hotfix 319976 does not apply to the issue that is described in this article. The problem that is described in article 319976 applies to Microsoft Visual Basic .NET 2002.

Properties

Article ID: 897299 - Last Review: December 6, 2006 - Revision: 2.3
APPLIES TO
  • Microsoft Visual Basic 2005
  • Microsoft Visual Basic .NET 2003 Standard Edition
Keywords: 
kbvs2005swept kbvs2005applies kbide kberrmsg kbcompiler kbexpertiseadvanced kbtshoot kbhowtomaster kbprb KB897299

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com