Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Can an extension inject an assembly / .dll into the debuggee?

$
0
0

Hi,

as a workaround for this issue:

https://developercommunity.visualstudio.com/content/problem/68105/debuggertypeproxy-attribute-in-autoexpcs-doesnt-wo.html

I have created an extension, that injects an assembly into the debuggee by evaluating an expression with this code:

            string expressionString = string.Format("System.Reflection.Assembly.LoadFile(@{0})", StringUtilities.SurroundWithQuotes(filePath));
            Expression expression = _dte.Debugger.GetExpression(expressionString);
            string expressionValue = expression.Value;

which enables the use of  the DebuggerTypeProxyAttribute (on the assembly level) in an arbitrary assembly. This works fine in VS2017, but returns 'Internal error in the expression evaluator.' in VS2019.

So, my question is: Is there an API/VS-Interface that allows to load an assembly into the debbuggee?

I could not find a suitable method on IVSDebugger,  IVSDebugger2, IVSDebugger3, ....


P.S: When I manually add the same expression in a watch-window, it works and loads the assembly into the debuggee.

Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>