Today I had an issue loading a web project from source control: when I open the solution file, I get an error about a System.Runtime.InteropServices.COMException:
And when I try to reload the project:
These errors occured somewhere in the communication between Visual Studio and IIS (By the way, I'm using Visual Studio 2008 and IIS 7, in a Windows Vista machine).
I could remove this error by simply editing the .csproj file, specifying that I don't want to use IIS:
<Project ...>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{...}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
...
But although on this machine I optionally could not use IIS, in my other development machine, I want to use it.
This error was occuring because I don't have the website configured on this machine. This is most likely to occur when we are first downloading a source controlled web project and don't have IIS configured yet.
So, I've configured IIS for having the URL specified in the .csproj pointing to my project directory. And now, everything should work ok!
Wrong! I get the same error...
Apparently I have to run VS2008 with administrative privileges for it to access IIS metadata. I don't like it, but at least until find a better solution, everything works as expected! :)