NOP Statements in IL

  • Thread starter Thread starter Randy Given
  • Start date Start date
R

Randy Given

When I look at the IL, using ILDASM, why does the VB.NET version have so
many NOP statements? The C# version doesn't seem to. What gives?
 
Randy,
VB.NET, as does C# 2.0, injects NOP statements into the IL to simplify
debugging, I understand mostly to allow you to put breakpoints on statements
that otherwise you could not (such as End If). I want to say .NET 2.0 puts
more NOP statements to help with the Edit & Continue feature of the debugger
(I don't have the specific reference handy, I just remember reading
something to that effect).

To remove them simply compile your project under the Release build, see
"Project - Configuration Manager - Active Solution Configuration" or simply
use the drop down on the tool bar.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top