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 <assembly name> could not be found at .\<assembly location>\ 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.
To correctly change the assembly name or the assembly namespace for your managed code extension, follow these steps:
Change the Name 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 name for your assembly in the Assembly Name box, and then click OK.
- On the Build menu, click Build Solution.
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( _ "OfficeStartupClass, Version=1.0, Class=MyNamespace.OfficeCodeBehind")>
- On the Build menu, click Build Solution.