Visual Studio 2008 – ASP.NET “System.Runtime.InteropServices.COMException”

The Issue

When openning an existing ASP.NET project for the first time in Visual Studio 2008 it returns the error “System.Runtime.InteropServices.COMException” without any HRESULT code. The problem I experienced was specificly on a Windows 7 machine, but the same solutions should work on Vista as well.

System.Runtime.InteropServices.COMException

 

1.Administrator – Visual Studio has to be “run as administrator” to acccess IIS applications, in Windows Vista and Windows 7. This is true even if you are logged into the computer as an Administrator. To run as an administrator, right click the Visual Studio shortcut and select “Run as Administrator”

You can also setup Visual Studio to always run as Administrator

  • Right click the Visual Studio shortcut.
  • Select properties
  • Click the advanced button
  • Check “Run as Administrator”.
  • Click OK

Visual Studio Shortcut - Advanced Options

 

2.只需要打开项目配置文件*.csproj,将<UseIIS>True</UseIIS> 改为 False,然后可以正常加载项目,接着重新配置为正常的IIS

你可能感兴趣的:(exception)