Remote Debugging only seeing transparent proxy

  • 10 October 2011
  • 2 replies
  • 0 views

Badge +1

When using remote debugging all objects are shown as transparent proxies, for example:


 ActivityInstanceDestination |{System.Runtime.Remoting.Proxies.__TransparentProxy} SourceCode.KO.ActivityInstanceDestination |{System.Runtime.Remoting.Proxies.__TransparentProxy}


 


The error I receive is like the following:


Cannot obtain fields or call methods on the instance of type 'SourceCode.KO.ActivityInstanceDestination' because it is a proxy to a remote object.


I have configured to show managed code only and am debugging in vs2010 using .Net 4.0. Is there anything that can be done to allow me to see the actual values of the objects?


 


2 replies

Badge +10

Hi,


If you haven't done so already follow the steps in the K2 blackpearl Documentation under Developer Reference > Development Techniques > Debugging a Process. The most important is the first step which states to disable the "Require source files to exactly match the original version" setting. Remote debugging also requires the Remote Debugging tools which I assume you have loaded.


Look through the settings in the documentation and let us know whether this helped solve the problem.


Regards,

Badge +10

Hi,


After posting my previous reply I remembered seeing something like this before.


Below is what one of our developers recommended as a fix for this:


With the move to VS 2010, please keep in mind that there is a bug in VS 2010 where breakpoints for a .NET 2.0.xxxx runtime app will NOT be hit if you use “Debug ? Start External Program”.


What that means is, if you set your startup application as K2HostServer.exe and attempt to debug, your breakpoints will not be hit.


Some reading material:
http://blogs.msdn.com/b/andrehal/archive/2010/04/29/can-t-hit-breakpoints-in-a-plug-in-or-can-t-debug-net-2-0-3-0-3-5-from-a-mixed-mode-exe-project-with-visual-studio-2010.aspx
http://connect.microsoft.com/VisualStudio/feedback/details/487949/debugging-external-application


The easiest way to solve this issue: Add a config file next to the native executable.


So, in %PROGRAMFILES%K2 BlackPearlHost ServerBin create a NEW config file called K2HostServer.exe.config. (Yes, I know there is already a file called K2HostServer.config, but IGNORE this file and create the new file…)
Add ONLY these entries:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
                <startup>
                                <supportedRuntime version="v2.0.50727" />
                </startup>
</configuration>


You will now be able to debug your application.


Even though this does not address your specific problem it might be related.


Please try it and let us know whether it resolved your problem.


Regards,

Reply