问题
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
After Debug Click
回答1:
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.
回答2:
If it works well in safe mode, it would be related to the extension tools/add-ins in your VS, as you said that you installed certain extension tools like Resharper or others, you could disable/remove them one by one under TOOLS->Extensions and Updates, so it could help us narrow down this issue:)
来源:https://stackoverflow.com/questions/41627447/vb-net-editor-removes-one-line-of-code-every-time-debug-is-started