Microsoft KB Archive/823244

= BUG: &quot;Library not registered&quot; error message when you start a new application project by using Visual C# .NET =

Article ID: 823244

Article Last Modified on 5/16/2007

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Visual C# .NET 2003 Standard Edition
 * Microsoft Visual C# .NET 2002 Standard Edition

-



SYMPTOMS
You have Visual Studio .NET 2002 or Visual Studio .NET 2003 installed on your computer. You create a setup project that includes Extensibility and VSLangProj assemblies, and then you install the setup project on your computer.

When you remove the setup project, and then create a new project by using Visual C# .NET, you receive the following error message:

Library not registered



CAUSE
This problem occurs because the setup project adds a dependency to the following files:
 * VSLangProj.dll
 * VsLangProj.tlb
 * Extensibility.dll
 * Extensibility.tlb

When you remove the setup project, the VSLangProj.tlb file and the Extensibility.tlb file are unregistered. However, Visual Basic .NET and Visual C# .NET use these TLB files. When you try to create a new application project, the project cannot find the Extensibility.tlb file and the VSLangProj.tlb file. Therefore, you receive the error message that is described in the &quot;Symptoms&quot; section.



WORKAROUND
To work around this problem, do one of the following:  Repair or re-install Visual Studio .NET 2002 or Visual Studio .NET 2003. To do this, follow these steps:  Quit Visual Studio .NET. In Control Panel, double-click Add or Remove Programs. Click Microsoft Visual Studio .NET, and then click Change/Remove. In Microsoft Visual Studio .NET Setup, click Visual Studio .NET, and then click Repair/Reinstall.

-or- Exclude the Extensibility assembly and the VSLangProj assembly from the setup project when you install the setup project on your computer.</li></ul>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to reproduce the behavior
Note To reproduce this behavior, you must have Visual Studio .NET 2002 or Visual Studio .NET 2003 installed on your computer.  In Microsoft Visual Studio .NET, use Visual Basic .NET or Visual C# .NET to create a new Windows Application project. By default, Form1 is created.</li> Add a new reference to this project, and then build the project. To do this, follow these steps:  In Solution Explorer, right-click WindowsApplication1, and then click Add Reference.</li> Click the .NET tab, click extensibility. Hold down the CTRL key, and then click VSLangProj. Release the CTRL key, and then click Select. Click OK.</li> On the Build menu, click Build Solution.</li></ol> </li> Add another project to the project that you created in step 1. To do this, follow these steps:  On the File menu, point to Add Project, and then click New Project.</li> In the Add New Project dialog box, click Setup and Deployment Projects under Project Types, click Setup Project under Templates, and then click OK. By default, Setup1 is created.</li> In Solution Explorer, click Setup1.</li> On the Project menu, point to Add, and then click Project Output.</li> In the Add Project Output Group dialog box, click Primary output, and then click OK.</li> On the Build menu, click Build Setup1.</li></ol> </li> <li>Install the project that you have created. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>On the Project menu, click Install.</li> <li>On the Welcome to the Setup1 page of the setup wizard, click Next.</li> <li>On the Select Installation Folder page, type the location where you want to install the project in the Folder text box.</li> <li>Click Next.</li> <li>On the Confirm Installation page, click Next.</li> <li>On the Installation Complete page, click Close.</li></ol> </li> <li>On the Project menu in Visual Studio .NET, click Uninstall.</li> <li>After the uninstall process is completed, quit Visual Studio .NET.</li> <li>Start Visual Studio .NET 2002 and Visual Studio .NET 2003, and then use Visual C# .NET to create a new Windows Application project.

You receive the error message that is described in the &quot;Symptoms&quot; section of this article.

Note If you use Visual Basic .NET to start the new Windows Application project, you do not receive an error message and the application project starts as expected.</li></ol>

<div class="references_section">