VS 2013 ASP.NET can't modify the code while debugging - asp.net

I'm working with a ASP.NET 2.0 project that has been upgraded from vs 2005->2010->2013.
In vs 2005 and 2010 I can modify the code while debugging, save the changes, and reload the page with the changes applied.
Now in vs 2013 I can't do this. Can't change the code when I hit a breakpoint. Tried to activate all checkboxs in "Edit & Continue" options, but nothing worked.
It's annoying having to stop debugging and recompile the app to debug again the changes.
How can I solve this?

FINALLY figured it out. Here are my findings.
To Reproduce:
I created 2 vanilla projects:
1) .net 4.0 project with VS2012 (ProjectA)
2) .net 4.5 project with VS2013 (ProjectB).
Then opened ProjectA with VS2013 and I couldn't Edit & Continue (E&C).
Resolution:
In VS2013, go into the project's properties on the "Build" tab and uncheck "Optimize Code".
I still don't know why I could Edit & Continue in VS2012 even with "Optimize Code" checked, but in VS2013, it won't work.
Resources:
Here is the link that aided me in locating the problem:
http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(vs.debug.ENC.SupportedButNotAvaiable);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.0);k(DevLang-csharp)&rd=true
Hope this helps!

I know this is a bit old, but I found the answer today - at least one answer. I'm running Visual Studio 2013 Update 1 and in my case, attempting to debug an MVC 5 application. Switch your target platform (in the Build menu) from Any CPU to either x64 for 64-bit or x86 for 32-bit.
I ran into this today while attempting to debug my MVC 5 application. After reading the release notes for Visual Studio 2013, including the fact that they added the ability in, I was puzzled. I checked my properties and saw that Optimize Code was unchecked while Edit & Continue were checked. The only other debugger marked was ASP.NET. On a hunch, I changed from targeting Any CPU to just targeting x64 under the Build menu. After that, I was able to use Edit and Continue as long as I wasn't attempting to edit lambdas or other items!

Find little solution for this case - close all files in solution before run debug.
Only files which were closed when debug is started can be edit.
Of file is opened when debug is start - edit is not possible.

What works for me, is the following:
1) Break point is hit, and I want to change code.
2) Now: Set next statement to somewhere earlier in the current function.
3) Do the change
4) Save / CTRL-s
5) Stepping through the function now includes the change.

Related

ASP.Net break point set but not firing in visual studio 2019

I've got a old asp.net project that I'm having trouble getting the breakpoints to hit when I open it in Visual Studio 2019.
It just seems to step over the breakpoints.
The project is set to Debug mode, I've also checked the output window and the symbols are being loaded.
If I add in the following line of the code
System.Diagnostics.Debugger.Break();
It will break, but if I remove the above line of code the break point on the next line does not get hit.
Has anyone else experienced behaviour like this and did you manage to solve the problem?
Has anyone else experienced behaviour like this and did you manage to
solve the problem?
Please try these:
1) delete all breakpoints under Debug-->Delete all breakpoints
2) check Managed Compatibility Mode under Tools->Options->Debugging-->General
and check Enable .NET Framework source stepping under Tools->Options->Debugging->General
3) close VS Instance, delete .vs hidden folder,bin,obj folder under the path of your project and then restart your project.
4) Right-click on your project-->Properties-->Build-->choose Optimize Code.
In addition, if these do not work, Running the VS command prompt as admin and then runn devenv /setup.
in my case it was ridiculous, in the emulator the network data was off, turning it on solved the problem

Visual Studio C# ASP .NET Web Form Designer Error

Ok, so I start a new project in Visual Studio (currently updated to update 3) and choose ASP.NET Web Application (.NET Framework).
Then I choose the Empty template and to add the folders and core references for Web Forms.
Ok, great, so I add a webform to the project and then find there's a problem:
Design view or even Split view is not available for the new aspx page.
Pressing the buttons 'Design' or 'Split' do nothing and only the source is seen, which also becomes uneditable.
Now I have seen this issue before and searched and searched for an answer. But the only solution was a complete reinstall - this means a few GB download and then hours of the install program doing whatever it does (it is the slowest install for anything on any platform).
This issue seems to occur randomly, and once it occurs, it seems to be permanent, short of a complete reinstall of VS.
Is this a fault in Visual Studio that will never be fixed?
Does someone actually know how to fix this other than a complete reinstall?
Please do not suggest to try 'Open With' on the aspx file - yes I have tried every option and the original default is the correct one.
Answers from the Microsoft forum are about as helpful as giving wheels to a tomato, such as here. It has even been highlighted for Visual Studio 2008 here. Someone seems to have tried to raise the issue last year here.

Visual Studio 2013 has stopped updating aspx.designer.cs files

I'm working on a large-ish web forms application and VS has stopped updating .aspx.designer.cs files in the last few days.
It seemed like the designer updates initially became flaky (sometimes update, sometimes not) then stopped updating altogether. Now I have to manually edit the designer file after adding a control to a page before I can compile.
I've searched and tried all the suggestions like switching from markup to design view and back etc - no change. The only thing that kind of works is this but even then the generated designer file often doesn't contain references to all the controls on the page. And also that only works on a per-file basis. Ideally I would like the whole project to update/generate designer files correctly again.
I've tried cleaning the solution - no change.
VS details:
Microsoft Visual Studio Professional 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework Version 4.6.00079
Installed Version: Professional
Any suggestions appreciated - thanks.
Make sure you're not running the application/site while adding controls. I've noticed that VS will lock the designer files while in debug mode and doesn't sync up when you exit debug mode.
Also, your link is broken, doesn't point to anything so I can't see what you were referencing to.
I think what caused this was a somewhat flaky local install of the project from TFS. It compiled but still had red squiggly lines under a few namespaces at design time. Once the project references were all clean the designer files were also updating correctly.

VS 2012 RTM Intellisense Broken

This seems to be happening on a project-by-project basis. Currently I am working on an ASP.NET 4.5 Web Application Project. Intellisense was fine one day but not the next. I am using a custom project template but that should make no difference. I tried editing the text editor settings so that Auto list members and Parameter information are both checked. I tried to reset your Visual Studio settings (Tools --> Import and export settings --> Reset all settings) and I also tried the solution in the accepted answer here:
Intellisense not working
Has anyone got any insight or suggestions? Pending any answers, I've submitted a Connect bug report: https://connect.microsoft.com/VisualStudio/feedback/details/766891/intellisense-broken-in-vs-2012-rtm
You may be able to refresh Intellisense cache with Ctrl + Shift + R (on standard shortcut keys)
I've had the same issue on VS2010 and fixed it another method described at How to turn IntelliSense on in Visual Studio 2010?
From the link:
Delete the files in this folder: %AppData%\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas (the 10.0 folder may be a different number for VS2012)
If nothing else works, you type this in the Visual Studio Command Prompt (this is in your Start menu) and hit enter: devenv /resetuserdata
This last option is documented here on MSDN, with the following disclaimer:
Disclaimer: you will lose all your environment settings and
customizations if you use this switch. It is for this reason that this
switch is not officially supported and Microsoft does not advertise
this switch to the public (you won't see this switch if you type
devenv.exe /? in the command prompt). You should only use this switch
as the last resort if you are experiencing an environment problem, and
make sure you back up your environment settings by exporting them
before using this switch.

vs2005 - Switching between design and source mode get stuck

I dont know if anyone else has had this problem. I'm using VS2005 working on a C# website.
The problem is on the .aspx page, when I click on the "Design" option two things happen.
It does not switch to design mode. I see only source. But I the problem is that the source mode gets stuck and uneditable.
Second thing is that I cannot switch back to source mode and hence am stuck only in that non-editable mode.
I tried to Reset my settings, but that hasnt helped.
Any ideas?
Try running visual studio in safemode. Launches Visual Studio in safe mode, loading only the default environment and services, and shipped versions of third party packages.
Try the below command in Start-> Run
devenv.exe /safemode
http://msdn.microsoft.com/en-us/library/xee0c8y7(v=vs.80).aspx

Resources