[英]Error while trying to edit code in debugging mode in VS2013
I'm a C# programmer and recently I've installed Visual Studio 2013. The problem is when i set a break point or get an error and trying to edit the codes while debugging I get this error and I couldn't find the same error searching on Google. 我是一个C#程序员,最近我安装了Visual Studio 2013.问题是当我设置一个断点或得到一个错误并试图在调试时编辑代码我得到这个错误,我找不到相同的错误在Google上搜索。
Changes are not allowed for this module as it was not built for changes while debugging or the target .NET runtime version does not support it
此模块不允许更改,因为它不是在调试时生成的更改,或者目标.NET运行时版本不支持它
I also tried to check the options on Tools -> Options -> Debugging -> Edit and Continue
, But didn't help. 我还尝试检查
Tools -> Options -> Debugging -> Edit and Continue
,但没有帮助。
Any idea what the problem is? 知道问题是什么吗?
To edit a C# program while you're running it in Visual Studio 2013: 要在Visual Studio 2013中运行C#程序时编辑它,请执行以下操作:
我遇到了同样的问题,发现顶部栏上的“解决方案配置”已更改为Release from Debug,因为我将最后一个版本构建到Release文件夹中。更改回调试模式将解决问题。
我们在Visual Studio 2013中遇到了同样的问题,在我们的例子中,这是因为我们在“项目设置”的“调试”选项卡上禁用了Visual Studio托管过程。
I just had the same problem and found a solution that worked for me right here after trying 100 other things: 我遇到了同样的问题,在尝试了100个其他的东西之后找到了一个适合我的解决方案:
https://stackoverflow.com/a/12543388/5367013 https://stackoverflow.com/a/12543388/5367013
1.) execute VsPerfCLREnv /globaloff 2.) reboot your computer 1.)执行VsPerfCLREnv / globaloff 2.)重新启动计算机
In a Web Forms application, I initially received the "Changes are not allowed for this module as it was not built for changes while debugging or the target .NET runtime version does not support it" error message. 在Web窗体应用程序中,我最初收到“此模块不允许更改,因为它不是为调试时的更改而构建的,或者目标.NET运行时版本不支持它”错误消息。 Based on suggestions above I completed the following:
根据上述建议,我完成了以下内容:
I tried to modify code, but then I received the "Edit and Continue" window stating "Changes are not allowed while code is running." 我试图修改代码,但后来我收到了“编辑并继续”窗口,指出“代码运行时不允许进行更改”。
Here was the important part: I can only make changes while stopped at a breakpoint. 这是重要的部分:我只能在断点停止时进行更改。 If the page is loaded, I get that same "Changes are not allowed..." message.
如果页面已加载,我会得到相同的“不允许更改...”消息。 So set a breakpoint to a line above where you need to make the change, complete the update and you should be set.
因此,设置断点到上面需要进行更改的行,完成更新,然后设置。
Or (as I subsequently discovered) another way to modify code without using a breakpoint is to click in Visual Studio "Debug/Break All" (Ctrl+Alt+Break), make your change and then press F5 or click the "Continue" button. 或者(我后来发现)另一种不使用断点修改代码的方法是在Visual Studio中单击“Debug / Break All”(Ctrl + Alt + Break),进行更改,然后按F5或单击“继续”按钮。 (Using this method you will might need a page refresh to see the mods.)
(使用此方法,您可能需要刷新页面才能看到mod。)
You can try 你可以试试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.