10

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.

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

I also tried to check the options on Tools -> Options -> Debugging -> Edit and Continue, But didn't help.

Any idea what the problem is?

14
  • Did you restart the debugging process and encountered same error after you configure Edit and Continue?
    – Stuart
    May 8, 2014 at 4:01
  • @Juan I did. and I'm having this error on 3 computers for 2 weeks.
    – Ghasem
    May 8, 2014 at 4:12
  • Were you allowed to do that on earlier versions of VS? I know you can have edit and continue in C++ but I've never known the option to be available in C#.
    – cup
    May 8, 2014 at 5:28
  • @cup Yeah i were allowed to do so on all the earlier versions. But I can't edit the same codes in VS2013.
    – Ghasem
    May 8, 2014 at 5:32
  • 1
    We encountered the same issue...found out that when adding fake assemblies edit and continue stopped working. Do you use fakes too?
    – martinoss
    Jul 25, 2014 at 12:57

8 Answers 8

10

To edit a C# program while you're running it in Visual Studio 2013:

  1. Go to Project, Properties, Build.
  2. Set Platform target: x86
  3. Disable "Optimize code"
  4. Set Advanced, Debug Info: Full
3
  • 1
    Did this already, still receive the same error message that OP is seeing
    – Jon
    Mar 4, 2015 at 15:58
  • @Mangist Did you also check the settings mentioned in the question and other answers, including the exceptions mentioned here? Mar 4, 2015 at 16:25
  • @JohnPeters Same question - Is my answer missing something from there? Apr 17, 2015 at 6:44
3

I came across the same issue and found that "solution configuration" on the top bar was changed to Release from Debug,because I build the last version into Release folder.Changing back to Debug mode will solve the issue.

0

The code your probably modifying is included in the exception. Since, your code is not posted here, I can't say. So please refer to this link and check whether it is really not allowed.

1
  • I get the same error even if there's no exception. It happens when I also try a break point.
    – Ghasem
    May 8, 2014 at 4:14
0

We just had the same issue in Visual Studio 2013 and in our case it was because we had disabled the Visual Studio Hosting Process on the Debug tab in Project Settings.

0

You can try

  1. Right click 'Solution' in the Solution Explorer.
  2. Select Properties.
  3. Choose Configuration Properties from the left menu.
  4. Select 'Debug' from the dropdown list in the upper-left corner labeled 'Configuration:'.
0

I just had the same problem and found a solution that worked for me right here after trying 100 other things:

https://stackoverflow.com/a/12543388/5367013

1.) execute VsPerfCLREnv /globaloff 2.) reboot your computer

0

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. Based on suggestions above I completed the following:

  1. Right click the project name, just under the Solution name in Solution Explorer and select Properties, the "Build" tab
  2. Set Platform target: x86 (Note, for me this was already set)
  3. Disable "Optimize code"
  4. Click the “Advanced” button (near bottom) and set, Debug Info: Full

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. (Using this method you will might need a page refresh to see the mods.)

0

Edit while debug

It worked for me by unchecking "Enable optimizations" option.

Please refer below image for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.