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? Commented May 8, 2014 at 4:01
  • @Juan I did. and I'm having this error on 3 computers for 2 weeks. Commented 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#. Commented 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. Commented 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? Commented 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
Sign up to request clarification or add additional context in comments.

3 Comments

Did this already, still receive the same error message that OP is seeing
@Mangist Did you also check the settings mentioned in the question and other answers, including the exceptions mentioned here?
@JohnPeters Same question - Is my answer missing something from there?
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.

Comments

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 Comment

I get the same error even if there's no exception. It happens when I also try a break point.
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.

Comments

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:'.

Comments

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

Comments

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.)

Comments

0

Edit while debug

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

Please refer below image for more info.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.