VB.Net 编辑器在每次启动调试时删除一行代码

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

我使用的是 Visual Studio 2015 Community Edition,我的问题是 - 每次单击“调试”时,一行代码都会移动到当前正在编辑的文件的上一行的右侧。我的一些同事也看到了这种行为。 C# 工作正常。它只发生在 VB.NET 中所有文件类型:web.config、.vb、.aspx。这会导致问题,因为该行在项目编译后被删除,因此调试器永远不会命中断点,因为它说源代码与编译前的原始代码不同。

调试点击前

调试点击后

如果在安全模式下能正常运行,那应该是和你的VS中的扩展tools/add-ins有关,正如你说的你安装了某些扩展工具,比如Resharper之类的,你可以disable/remove它们在“工具”->“扩展和更新”下一个一个地显示,因此它可以帮助我们缩小这个问题的范围:)

您的问题看起来与 here 中描述的问题非常相似,因此请尝试解决方法:

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.