vb.netvisual-studio-debuggingvisual-studio-community

VB.Net editor removes one line of code every time debug is started


I'm using Visual Studio 2015 Community Edition and my problem is - every time when I click debug, one line of code is moved to the right of the previous line from the current file being edited. Some of my coworkers have seen this behavior too. C# works fine. It happens only in VB.NET with all file types: web.config, .vb, .aspx. This causes a problem because the line is removed after the project is compiled, so the debugger can never hit breakpoint because it says that the source code is different from the original that was before compilation.

Before Debug Click

Before Debug Click

After Debug Click

After Debug Click


Solution

  • Your issue looks quite similar to one described here, so try a workaround:

    In my case, the linke break problem only happens if you have DevExpress components AND the Licences.licx file exists in you project. Emptying the licences.licx file in a pre-build event fixes the problem and resharper no longer removes a line break.