QAID # 16107 Published
Question / Problem:
Using Visual Studio 2008 or 2010, with .NET Framework 4.0 installed, why is Visual Studio unable to debug a VB.NET or C# Recognition Script, Validation Script, Workflow Agent or Export Connector created with .NET 2.0 thru 3.5 SP1?
Answer / Solution:
Capture was created using Visual C++ and Visual Basic 6 as well as .NET Framework 2.0 (Capture 8.0) or .NET Framework 3.5 SP1 (Capture 9.0 and 10.0).
Because of this blend of Managed (.NET) and Unmanaged (Non-.NET) components, some modules, such as Administration, Validation and Export, are "Unmanaged", and will run against the latest version of the .NET Framework installed, which can be .NET Framework 4.0.
When a customization that was created in .NET 2.0, 3.0, 3.5 or 3.5 SP1, such as a VB.NET Validation Script is debugged, Visual Studio is expecting the .NET 2.0-3.51 debugger to load the DLL.
If the customization is loaded against .NET Framework 4.0, this does not occur, so Visual Studio is then unable to communicate with the debugger, and no breakpoints are intercepted.
To work around the issue, it is recommended to redirect the module loading the .NET 2.0-3.5 SP1 customization to utilize .NET CLR 2.0.
This can be done by creating/modifying a Configuration file for the customization:
- Open Notepad and paste the following into the editor:
<?xml version="1.0"?> <configuration> <startup> <supportedRuntime version="v2.0.50727"/> <requiredRuntime version="v2.0.50727" safemode="true"/> </startup> </configuration>
- Save the file as
.exe.configfor the module involved (in the Capture\BIN folder):
IMPORTANT: If a .exe.config file already exists, modify the existing file rather than overwriting it, so that existing settings are preserved.
Visual Studio should then be able to attach to the module beign debugged, and utilize the .NET 2.0-3.5 SP1 debugger.
After debugging, simply delete/restore the files.