I am an engineer on the Visual Studio Debugger team.
Correct me if I am wrong, but it sounds like the only issue left is that when switching from PDBs to the .NET 4 dynamic compile symbol format some breakpoints are being missed.
We would probably need a repro to exactly diagnose the issue, however here are some notes that might help.
- VS (2008+) can-to run as a non-admin
- Do any symbols load at all the second time around? You might test by breaking in (through exception or call System.Diagnostic.Debugger.Break())
- Assuming that symbols load, is there a repro that you could send us?
- The likely difference is that the symbol format for dynamic-compiled code is 100% different between .NET 2 (PDB stream) and .NET 4 (IL DB I think they called it?)
- The ‘nop’s sound about right. See rules for generating implicit sequence points below.
- You don’t actually need to emit things on different lines. By default, VS will step ‘symbol-statements’ where, as the compiler writer you get to define what ‘symbol-statement’ means. So if you want each expression to be a separate thing in the symbol file, that will work just fine.
The JIT creates an implicit sequence point based on the following rules:
1. IL nop instructions
2. IL stack empty points
3. The IL instruction immediately following a call instruction
If it turns out we do need a repro to solve your issue, you can file a connect bug and upload files securely through that medium.
Update:
We are encouraging other users experiencing this issue to try the Developer Preview of Dev11 from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27543 and comment with any feedback. (Must target 4.5)
Update 2:
Leppie has verified the fix to work for him on the Beta version of Dev11 available at http://www.microsoft.com/visualstudio/11/en-us/downloads as noted in the connect bug https://connect.microsoft.com/VisualStudio/feedback/details/684089/.
Thanks,
Luke