An application that is developed in Visual Studio 2005 and that uses COM components stops responding when the application is deployed by using ClickOnce technology (907758)



The information in this article applies to:

  • Microsoft Visual Studio 2005 Standard Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Express Edition
  • Microsoft Visual Studio 2005 Team System Architect Edition
  • Microsoft Visual Studio 2005 Team System Developer Edition
  • Microsoft Visual Studio 2005 Team System Test Edition

SYMPTOMS

When you try to start a Microsoft Windows application or a console application, the application stops responding. This behavior occurs when the following conditions are true:
  • The application is developed in Microsoft Visual Studio 2005 and is built on the Microsoft .NET Framework.
  • The application uses Microsoft Component Object Model (COM) components.
  • The application is deployed by using ClickOnce technology.

CAUSE

You cannot use ClickOnce technology to deploy an application that requires an explicit call to the CoInitializeSecurity function to customize the COM security level.

STATUS

This behavior is by design.

MORE INFORMATION

In Visual Studio 2005, when you create a managed application that interoperates with COM, the common language runtime (CLR) calls the CoInitializeSecurity function before the application interoperates with COM.

Note Interoperating with COM is generally referred to as COM interop.

When you start a ClickOnce application, the CLR calls the CoInitializeSecurity function when the CLR starts. The CLR starts before any application code is run. The first time that the CoInitializeSecurity function is called, the CoInitializeSecurity function sets the level of security access for the application. After the first time that the CoInitializeSecurity function is called, the level of security access for the application cannot be changed. The level of security access that is provided when the CLR calls the CoInitializeSecurity function may be lower than the level of security access that the application requires. When the level of security access that is provided is lower than the level of security access that the application requires, the application does not run.

Modification Type:MajorLast Reviewed:3/9/2006
Keywords:kbdesign kbnofix kbtshoot kbprb KB907758 kbAudDeveloper