Question:
We have quite a few objects in which ToSrting () or the values of some properties call the wcf service when calculating. This works fine in production mode, but problems start when trying to debug the client code.
As soon as the debugger enters the place where there is such code (on the client), it hangs for about a minute, then displays the message "Attempt to execute managed code under the OS Loader lock". Disabling this warning in Managed Debugging Assistants does not solve the problem: the debugger hangs for a minute, then the client being debugged is silently shut down.
I saw how the debugger of one colleague did not hang on this, but only gave out that it was impossible to calculate the value of the property. But he did not know how his Studio settings differ from ours; moreover, now he quit his job and gave his laptop to the customer.
Answer:
It seems that the problem is solved like this: when you debug something on the client, you need to start the server without a debugger.
The Studio also has a setting that disables the automatic calculation of properties / ToStrings by the debugger (Debugging / Enable property evaluation and other implicit function calls).