Debugging aspected code without extra effort
When we try to debug a method that has aspects, debugger behaves strangely seemingly not in sync with its binary.
After trying the recommendation in this link we can debug, but it seems like a hassle if we don't need to debug the actual aspects.
Is there a way to enable default debugging behavior, so that we don't need to use LamaDebug configuration and debug through aspect code to get to the code we are interested in?
Thanks!
Hello,
LamaDebug, among other things, sets the MetalamaDebugTransformedCode property to True, which enables the debugging.
So, if you create Directory.Build.props that looks like the following, you should get the behavior you want:
<?xml version="1.0" encoding="utf-8" ?>
<Project>
<PropertyGroup>
<MetalamaDebugTransformedCode Condition="$(Configuration) == 'Debug'">True</MetalamaDebugTransformedCode>
</PropertyGroup>
</Project>
However, note that this would also automatically format the output code, which results in worse build performance for all Debug builds.
Thank you for response @addabis , your solution helps in a way that we don't have to create separate LamaDebug configuration.
The drawback however is that we still see aspect code and have to debug through it (though 99 percent of time we are not interested in that).
So it is not possible to debug only our custom code like we were able with PostSharp?
If there is a defect in debugging behavior, it would be best to record a video demonstrating the issue and give the code of the aspect that causes it.
@gfraiteur, I thought this was expected behavior. When not using LamaDebug configuration it looks like debug pointer is following hidden aspect code, jumping around custom code. Similar to when binary being debugged is not in sync with source code.
I will try to prepare test project shortly.
Closed because we don't know how to reproduce the issue.