Article ID: 935232 - Last Review: May 2, 2007 - Revision: 1.1

How to change the value of the ComVisibleAttribute attribute in Visual Studio 2005

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.

On This Page

Expand all | Collapse all

INTRODUCTION

This article describes how to change the value of the ComVisibleAttribute attribute in Microsoft Visual Studio 2005 for software development. The ComVisibleAttribute attribute determines how Microsoft Component Object Model (COM) clients access the managed code.

Note By default, the value of the ComVisibleAttribute attribute is True in Visual Studio 2005 and in earlier versions of Visual Studio.

MORE INFORMATION

To change the value of the ComVisibleAttribute attribute in Visual Studio 2005, use one of the following methods.

Method 1: Change the value of the ComVisibleAttribute attribute at the assembly level

To change the value of the ComVisibleAttribute attribute at the assembly level, follow these steps:
  1. Start Visual Studio 2005.
  2. On the View menu, click Solution Explorer.
  3. In Solution Explorer, click a project node.
  4. On the Project menu, click a project name, and then click Properties.

    Alternatively, right-click a project node in Solution Explorer, and then click Project.
  5. In the Project Designer, click the Application tab.
  6. On the Application page, click Assembly Information.
  7. In the Assembly Information dialog box, click to select the Make assembly COM-Visible check box, or click to clear the Make assembly COM-Visible check box.
  8. Click OK.

Method 2: Change the value of the ComVisibleAttribute attribute at the type level

For information about how to change the value of the ComVisibleAttribute attribute at the type level, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.comvisibleattribute(vs.80).aspx (http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.comvisibleattribute(vs.80).aspx)
Note When you do not explicitly set the ComVisibleAttribute attribute for a type, the value of the ComVisibleAttribute attribute that is set at the assembly level is used as the value for that type.

REFERENCES

For more information about the Assembly Information dialog box, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/1h52t681(VS.80).aspx (http://msdn2.microsoft.com/en-us/library/1h52t681(VS.80).aspx)

APPLIES TO
  • Microsoft Visual Studio 2005 Team Edition for Software Architects
  • Microsoft Visual Studio 2005 Team Edition for Software Developers
  • Microsoft Visual Studio 2005 Team Edition for Software Testers
  • Microsoft Visual Studio 2005 Standard Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Express Edition
Keywords: 
kbinfo kbexpertiseinter kbhowto KB935232