DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 824003 - Last Review: February 3, 2006 - Revision: 1.5

On This Page

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 <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

  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.

Change the Namespace 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 namespace for your assembly in the Root Namespace box, and then click OK.
  6. Locate the Assembly: System.ComponentModel.DescriptionAttribute attribute in your ThisWorkbook code module or in your ThisDocument code module.

    This is the Office Integration attribute.
  7. 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")>
  8. On the Build menu, click Build Solution.

REFERENCES

For additional information about how to grant permissions to folders and to assemblies and about how to troubleshoot in Office at runtime, see the documentation for Visual Studio Tools for the Microsoft Office System.


APPLIES TO
  • Microsoft Office Professional Edition 2003
  • Microsoft Office Excel 2003
  • Microsoft Visual Studio Tools for the Microsoft Office System version 2003
Keywords: 
kbpia kbhowtomaster KB824003
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support