I've got a problem with VS2010 compiler generating IL 'Break' OpCodes when there are no breakpoints in the solution.
Using the Reflection.Emit functionality, I have implemented a factory that generates a class with a default implementation to a provided interface. The factory takes an interface type and generates a class with methods according to the
provided interface. The problem is that IL 'Break' OpCodes starts to appear in some of the the generated methods (for now, they only appear in methods that takes two parameters). This causes VS to halt the execution until I press F10, which makes
it extra hard to debug the time-critical part of the code.
When I was debugging the code earlier, I placed a breakpoint inside a anonymous delegate that called one of the methods in the generated class. I have now removed all breakpoints (no breakpoints are shown in the VS Breakpoint panel), but still Visual Studio
halts the execution when a method that takes two parameters in the generated class is called.
Since I'm sure I'm not using the 'Break' OpCode anywhere in the code (and I'm not using System.Diagnostics.Debugger.Break anywhere either), my guess is that Visual Studio generates it while compiling based on some stored information about breakpoints?! I
have deleted the solution options file (.suo), all PDB f
View Complete Post