Exceptions debugging CustomProject Sample

Sep 19, 2011 at 6:50 PM

I'm trying to use the CustomProject sample to understand how to build my own project extension.  I keep encountering exceptions when debugging the CustomProject sample in the VS2010 Experimental instance:

System.ArgumentException was unhandled by user code
  Message=InvalidParameter
Parameter name: index
  Source=Microsoft.VisualStudio.Project.Samples.CustomProject
  ParamName=index
  StackTrace:
       at Microsoft.VisualStudio.Project.Automation.OAProperties.Item(Object index) in C:\data\projects\mpfproj10-51806\Dev10\Src\CSharp\\Automation\OAProperties.cs:line 177
       at Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager.get_IsRemoteProject()
  InnerException:

The value of index in this context is "WebSiteType".  I've noticed this occurs in the following situations:

  • After creating a new CustomProject and closing the solution
  • After creating a new CustomProject, selecting a project item in solution explorer, and clicking the Project menu

I am using VS2010 Ultimate SP1, VS2010 SDK SP1 and MPFProj10 51806.

Any ideas or help would be very much appreciated.  Thanks!

Jun 26, 2012 at 8:44 PM

Any resolution to this?  I am running into the same scenario.

Thanks.

Jun 26, 2012 at 9:41 PM

It's unclear from your question whether this is actually presenting a problem to you, or if it's just something you're wondering if it's a problem.  

This is actually expected behavior.  The MSDN documentation for this method prescribes that any unsupported property throw an ArgumentException.  So while it's not ideal that when the debugger is attached it can raise all these exceptions which look like errors when in fact they are not, it's by design, and you can ignore them.