Microsoft KB Archive/913453

= Error message when you use a visualizer or a type proxy when you debug in Visual Studio 2005: &quot;Cannot create an instance of &quot; =

Article ID: 913453

Article Last Modified on 5/18/2006

-

APPLIES TO


 * Microsoft Visual Studio 2005 Team System Architect Edition
 * Microsoft Visual Studio 2005 Team System Developer Edition
 * Microsoft Visual Studio 2005 Team System Test Edition
 * Microsoft Visual Studio 2005 Tools for the Microsoft Office System
 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition

-





SYMPTOMS
Consider the following scenario. You use a visualizer or a type proxy when you debug in Microsoft Visual Studio 2005. The visualizer or the type proxy is a generic type. In this scenario, you may receive an error message that resembles the following:

System.ArgumentException: Cannot create an instance of  because Type.ContainsGenericParameters is true.



CAUSE
This behavior occurs because Visual Studio 2005 does not support the generic type for a visualizer or for a type proxy.

When you debug in Visual Studio 2005, the debuggee side sends the data object to the visualizer in the debugger side. To correctly display the data object in the visualizer, Visual Studio 2005 requires that the visualizer or the type proxy be fully instantiated before the debugger receives the data object from the target type. If the visualizer or the type proxy is a generic type, the visualizer or the type proxy cannot be fully instantiated before the debugger receives the data object.

Note You can write a visualizer for a target that is a generic type only if the generic type is an open type.



STATUS
This behavior is by design.



MORE INFORMATION
For more information about how to write a visualizer, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/e2zc529c(VS.80).aspx

Keywords: kberrmsg kbtshoot kbprb KB913453

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.