Microsoft KB Archive/935232

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

Article ID: 935232

Article Last Modified on 5/2/2007

-

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

-



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.
 * 1) In the Project Designer, click the Application tab.
 * 2) On the Application page, click Assembly Information.
 * 3) 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.
 * 4) 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

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.

