too much System.Runtime.InteropServices.ComException ?? :(

Jaime Rodriguez
On Windows Phone, Windows Presentation Foundation, Silverlight and Windows 7

too much System.Runtime.InteropServices.ComException ?? :(

  • Comments 1

Lately, I have been seeing System.Runtime.InteropServices.COMException quite often when I launch Visual Studio 2008 to work on Silverlight projects..    

Here is what I know causes the error..

  • Error happens when I have wrong templates installed (e.g. running old versions of the Silverlight tools for 1.1), in particular versions that were meant for VS 2008 beta2..  
    Workaround:
    1. Uninstall the old tools,
    2. install new tools
    3. from an administrator command prompt, run
      C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv /REsetSkipPkgs
  • Error also happens when I am trying to open a "Web Application project" in Windows Vista and I have not launched Visual Studio with elevaged privileges..
    Workaround:
    1. Run VS with elevated privileges ....  OR
    2. Open project as a web site...  ( File -> Open -> Website and navigate to directory)
  • There is one more scenario, but that one should not be happening to most people.. if you install a later or internal build of the VS tools for Silverlight...  and then end up rolling back to old tools.

If you are seeing the error, my reccomendation is to at least try
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv /REsetSkipPkgs
That seems to help a lot of things.. 

Want to know which one gets me?? I forget to elevate, and I need Web App projects (instead of Open As website) because I need 'post-build steps' ... 

Cheers,