Microsoft KB Archive/824003

= HOW TO: Change the Assembly Name or the Assembly Namespace for Your Office Managed Code Extension =

Article ID: 824003

Article Last Modified on 2/3/2006

-

APPLIES TO


 * Microsoft Office Professional Edition 2003
 * Microsoft Office Excel 2003
 * Microsoft Office Word 2003
 * Microsoft Visual Studio Tools for the Microsoft Office System version 2003

-



IN THIS TASK

 * SUMMARY
 * Change the Name of an Assembly
 * Change the Namespace of an Assembly
 * REFERENCES



SUMMARY
This step-by-step article describes how to change the name of an assembly or how to change the namespace of an assembly for a managed code extension that you create with Microsoft Visual Studio Tools for the Microsoft Office System.

To change the name for your assembly or the namespace for your assembly, you must modify properties in the Office project and then rebuild the assembly.

If you instead try to modify the assembly name in Microsoft Windows Explorer by renaming the assembly file, or if you do not change the Office Integration attribute after you change the Root Namespace property in the project, you may receive the following error message when the managed code extension is loaded in Microsoft Word or in Microsoft Excel:

The assembly could not be found at .\ \ or could not be loaded. You can still edit and save the document. Contact your administrator or the author of this document for further assistance.

back to the top

To correctly change the assembly name or the assembly namespace for your managed code extension, follow these steps:

Change the Name of an Assembly

 * 1) Start Visual Studio .NET 2003, and then open your Office project.
 * 2) On the View menu, click Solution Explorer.
 * 3) In Solution Explorer, right-click your project, and then click Properties.
 * 4) In the Common Properties list, click General.
 * 5) Type the new name for your assembly in the Assembly Name box, and then click OK.
 * 6) On the Build menu, click Build Solution.

back to the top

Change the Namespace of an Assembly
 Start Visual Studio .NET 2003, and then open your Office project. On the View menu, click Solution Explorer. In Solution Explorer, right-click your project, and then click Properties. In the Common Properties list, click General. Type the new namespace for your assembly in the Root Namespace box, and then click OK. Locate the Assembly: System.ComponentModel.DescriptionAttribute attribute in your ThisWorkbook code module or in your ThisDocument code module.

This is the Office Integration attribute.  Modify the Office Integration attribute to reflect the new namespace.

For example, if you named your namespace MyNamespace, the Office Integration attribute appears in the code module as follows: <Assembly: System.ComponentModel.DescriptionAttribute( _  &quot;OfficeStartupClass, Version=1.0, Class=MyNamespace.OfficeCodeBehind&quot;)> </li> On the Build menu, click Build Solution.</li></ol>

back to the top

<div class="references_section">