for some reason this no longer works. I ugraded the winforms solution from VS2008 to VS2010 and on new machine also Windows 7 64bit but id does not allow edit and continue
I haver set the options to enable it and to compile against 86 cpu
any ideas?
also Windows 7 64bit
Edit+Continue only works for 32-bit code. Easy fix, and the default now for VS2010 projects: Project + Properties, Build tab, Platform target = x86. You can of course leave that setting for your Release configuration at Any CPU.
try this link. quoting from it
Edit and Continue is enabled under Tools>Options>Debugging>Edit and Continue
My solution platform is set to x86
My solution configuration is set to Debug
All my projects are building for Debug and x86
For all projects under Projects>Properties>Build the Optimize code is unchecked
tools->options->unselect intellitrace events and call information
I know it's a old question... but I not found a similar answer on another question.
I was having this issue for months. I found today a solution on my PC (win7 x64):
I run VS2010 with administrator privileges (uac enabled, popup appears and I accept everytime that I run vs 2010) this is because I need a 3rd party addon to work.
It appears that running vs 2010 with admin privileges make it run on another account or something else...
I checked one setting on vs2010 that allowed me to edit and continue now again :)
this option is under:
Tools/Options/Debugging -> Edit and Continue -> check "Enable while remote debugging or debugging and aplication running under another user account"
note: vs2010 will show a warning (security related...).. I not sure how dangerous it is... but works
I hope that this solution can help someone.
In my situation, someone added a Reference to the Project's output into the Reference list: in Solution Explorer look under [ProjectName]\References for [ProjectName*] and remove it. If the project is relying on code from a copy of itself, you can't 'Edit and Continue'.
In the warning list you'll see conflicts with imported type messages if this was the cause of the problem.
I've seen this as well. It seems that some stuff of the expressions and lambdas cause this. ;(
I have the same problem and found this info from the MSDN page "How to: Use Edit and Continue (C#)" :
Note
Edit and Continue is not supported when debugging 64-bit code, the Compact Framework, optimized code, mixed native/managed code, or SQL Server common language runtime (CLR) integration code. If you try to apply code changes in one of these scenarios, the debugger puts up a dialog box explaining that Edit and Continue is not supported.
I think the mix of native/managed code is the problem for me (my project indeed mixes them).
Related
I have been assigned to work on a Windows Service project. I installed it in my machine using installer class (ProjectInstaller.cs). I want to debug the source code and sometimes need to make changes while it is in debug mode. I attached the process via Debug menu to debug the project which works fine but it throw an error while I am trying to edit or continue the source code:
Managed Compatibility Mode does not support Edit and Continue
I googled and tried tons of solutions but none of them worked for me, couple of them are as below:
Unchecked the Use Managed Compatibility Mode from Tools -> Options
Unchecked Managed Compatibility Mode from Debug -> Attach to Process
-> Attached To -> Select...
Checked the Managed (v4.6, V4.5, V4.0) from Debug -> Attach to
Process -> Attached To -> Select...
Played with Platform target in Project Build.
Added {351668CC-8477-4fbf-BFE3-5F1006E4DB1F} field in my .csproj file
The error message varies depending on different solutions I implemented.
Below is the link I last time tried:
https://blogs.msdn.microsoft.com/visualstudioalm/2013/10/16/switching-to-managed-compatibility-mode-in-visual-studio-2013/
I am guessing: the last one didn't work because I do not have an exe project for my service instead I have implemented ProjectInstaller.cs Class and manually installed it through command prompt.
Any suggestion/recommendation are welcomed.
Edit and Continue requires many factors which are not obvious to users. Your case is simply not supported (mostly for attaching cases).
See Supported Code Changes (C#) in MSDN. In particular:
Edit and Continue is not available in the following debugging scenarios: [...]
Debugging an application that has Attach to instead of running the application by choosing Start from the Debug menu.
Unckeck Use Managed Compatibility Mode, It working for me! and you must Enable Edit and Continue in Debuging General
Attaching my process for each debug was a headache for me.
Just want to share a link that saved a lot of my time by writing a simple method and calling it in Main() method inside Program.cs.
This also gives me flexibility to edit and continue my code as simple as WinForm / Web Form. LOVE IT.
https://coding.abel.nu/2012/05/debugging-a-windows-service-project/
I reset the VISUAL STUDIO settings and the problem is resolved
hope it helps to Reset visual studio setting
I can't seem to be able to debug. When I try to, I don't get any build errors, and the layout changes to debug mode, but the windows never pops up. I have an orange bar at the bottom of VS, which I think is standard, but nothing happens after that. It's not just in the project I'm working on. I have started a new WFA and tried to debug without adding any code and the same thing happens. Anybody have similar issues?
I've encountered this before. Not sure what causes it, but generally it is one of a couple of things to fix it.
make sure you are building in debug and not release
close VS, go to the project's dir and delete the obj and bin directories. Reopen in VS and rebuild.
there is an option under tools - options - build (iirc) that allows for checking if source is same as code file. However, you should see a message in output window if this is the case.
on the project properties in the build (iirc) you can throttle the pdb file from full debug symbols to no pdb at all. If you are not the only person on the project check this setting still has full pdb enabled (low probability this got changed though)
make sure you're on the right platform that you are building to (x64 vs x32)
...lots more, but a starting place...
Addendum as per comment...
So, those messages are good. It is saying there are no problems (but it sounds like you already know that :) ). I would start with the general debug options you mention. Do this on a hello world app. That way you can troubleshoot the lowest common first. Here are my settings. Try to match them and see if that works. For example, I know "ask before deleting breakpoint" is irrelevant, but "break all processes when one process breaks" is important. So, I just added them all to make it easier to troubleshoot.
ALso, make sure you are getting a red dot here like so in your code in visual studio (I've seen instances where VS won't let you put this here):
Right click on the project
Click on the properties.
go to web.
Check the Box for Enable Edit and Continue .
Hope that helps :)
This is an issue with visual studio 2012. It doesn't ALWAYS show up. I've found that if you stop your program during debugging, or if you close the console window, this will almost always trigger.
However, letting it run to completion isn't enough either, sometimes this just happens.
Also you can build your application in debug mode, go to the output, run the program, and attach to that process. :P
Amazing answers already given but they dont help in the purpose. So here is my finding, no matter if i am late in answering, but it really works for me.
Even if you are developing a web app, just go to the website properties by right-clicking the project and then you see a "Web" tab on left as i have highlighted. Then just check the box saying "Enable Edit and Continue". Thats all you need to do. it works for me!
I had a similar problem, and solution was absolutely dumb. VS was confused with two instances of Internet Explorer in “Browse with” setting. So, I set Google Chrome (any browser) as default, and then set IE as default again. It deleted the other instance of IE (only one remained) and debugging was enabled.
Hope it help!
I had a similar issue.
I added up:
using namespace std;
and this solved the problem
For me, uninstalling the Redgate's Reflector plugin that had expired fixed it. I spent more than 4 hours uninstalling, rebooting, reverting to older code, etc etc..
When my default browser was changed to CHROME, I could no longer debug my User Interface. Setting IE back to the default browser fixed it. Alternatively you can attach the process plug-in during debug.
I had the same problem with my desktop application and as this forum says you should mark your project as a startup project, since visual studio has unmarked. It worked just fine for me an I believe it will help other people that may have this problem, since I believe you have finished this project.
One of my VB .NET Winforms projects wouldn't allow debugging.
This was due to the configuration manager set to 'Release' even though the toolbar dropdown indicated 'Debug'.
You need to select the mode dropdown and select the last option 'Configuration Manager' and ensure that the main project is set to 'Debug' and not 'Release'
Install Microsoft SSDTSetup.exe 450Kb and Close the SSDT tool during install. After installation open the SSDT tool and execute the script task and Component with breakpoint. Worked for me
try checking your output without debugging
Ctrl + F5
good luck
I have been trying to run the first skeleton program listed here:
https://sites.google.com/site/augmentedrealitytestingsite/download
I am using VS2010 express under Windows 7 64bit.
When I tried to build and run, it first threw:
"An attempt was made to load a program with an incorrect format"
Followed shortly by a System.BadImageFormatException due to calling a PInvoke method from the referenced ARTKPManagedWrapper.DLL.
I recompiled the reference on my PC but the problem persisted. I also tried to set the target platform to x86 (it is currently set on Any CPU) but there was no option other than Any CPU.
Does anyone have any idea what else could be going wrong here?
You have to create the option if it isn't there. I was able to get it to work by going into Build --> Configuration Mananger going into the Platform Column and creating an new x86 configuration.
If configuration manager is not visible to you. You will want to look at this Blog
From Blog:
First, select Tools|Options to bring up the Options dialog.
Make sure that "Show all Settings" in the bottom left-hand corner is set.
Select the Projects and Solutions page and set "Show Advanced build configurations."
and from the Comments
You've just got to ensure that Tools -> Settings -> Expert Settings is selected as well.
In IIS on the app pool for the website under the advanced settings change the following setting
Enable 32 bit applications to true.
Visual Studio 2010 kills (there is no other word) data in one of the arguments of the function in the unsafe block.
What could cause this error? The following message shows by the debugger.
Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away.
Go to Project Properties and under Build Make sure that the "Optimize Code" checkbox is unchecked.
Also, set the "Debug Info" dropdown to "Full" in the Advanced Options (Under Build tab).
Also
In VS 2015 Community Edition
go to
Debug->Options or Tools->Options
and check
Debugging->General->Suppress JIT optimization on module load (Managed only)
If you compile with optimizations enabled, then many variables will be removed; for example:
SomeType value = GetValue();
DoSomething(value);
here the local variable value would typically get removed, keeping the value on the stack instead - a bit like as if you had written:
DoSomething(GetValue());
Also, if a return value isn't used at all, then it will be dropped via "pop" (rather than stored in a local via "stloc", and again; the local will not exist).
Because of this, in such a build the debugger can't get the current value of value because it doesn't exist - it only exists for the brief instant between GetValue() and DoSomething(...).
So; if you want to debug... don't use a release build! or at least, disable optimizations while you debug.
In visual Studio 2017
goto Debug->Option then check Debugging->general->
and check this option
I just ran into this and I was running under Release build configuration instead of Debug build configuration. Once I switched back to Debug my variable showed in the watch again.
For web applications there is another issue which is important and it is selecting correct configuration during application publish process.
You may build your app in debug mode, but it might happen you publish it in release mode which omptimzes code by default but IDE may mislead you since it shows debug mode while published code is in release mode.
You can see details in below snapshot:
I have faced the same issue and the solution for me is change Solution Configuration from Release to Debug. Hope it helps
When I was faced with the same problem I just had to clean my solution before rebuilding. That took care of it for me.
Regarding the problem with "Optimize code" property being UNCHECKED yet the code still compiling as optimized: What finally helped me after trying everything was checking the "Enable unmanaged code debugging" checkbox on the same settings page (Project properties - Debug). It doesn't directly relate to the code optimization, but with this enabled, VS no longer optimizes my library and I can debug.
In my case, I was working on a web api project and although the project was set correctly to full debug, I was still seeing this error every time I attached to the IIS process I was trying to debug. Then I realized the publish profile was set to use the Release configuration. So one more place to check is your publish profile if you're using the 'Publish' feature of your dotnet web api project.
I found that I had the same problem when I was running a project and debugging by attaching to an IIS process. I also was running in Debug mode with optimizations turned off. While I thought the code compiled fine, when I detached and tried to compile, one of the references was not found. This was due to another developer here that made modifications and changed the location of the reference. The reference did not show up with the alert symbol, so I thought everything was fine until I did the compilation. Once fixing the reference and running again it worked.
As an additional answer for those experiencing this issue when debugging an Azure websites' web app:
When deploying from GitHub, for example, the code is compiled in Azure server optimized by default.
I tell the server to compile in a debuggable way by setting SCM_BUILD_ARGS to /p:Configuration=Debug
but there are more options. See this:
http://azure.microsoft.com/blog/2014/05/08/introduction-to-remote-debugging-on-azure-web-sites-part-3-multi-instance-environment-and-git/
In Visual Studio 2017 or 2015:
Go to the Solution right click on solution then select Properties-> select all the Configuration-> Debug then click OK.
After that Rebuild and Run,this solution worked for me.
Had the same issue before with a WPF application and all the solutions here did NOT solve the issue. The problem was that the Module was already optimized so the previous solutions DO NOT WORKS (or are not enough to solve the issue):
"Optimize Code" checkbox un-Checked
"Suppress JIT optimization on module load" checked
Solution configuration on DEBUG
The module is still loaded Optimized. See following screenshot:
To SOLVE this issue you have to delete the optimized module. To find the optimized module path you can use a tool like Process Hacker.
Double click your program in the "Process panel" then in the new window open the tab ".NET Assemblies". Then in the column "Native image path" you find all Optimized modules paths. Locate the one you want to de-optimize and delete the folder (see screenshot below):
(I blurred my company name for obvious reasons)
Restart your application (with check box in step 1 correctly checked) and it should works.
Note: The file may be locked as it was opened by another process, try closing Visual Studio. If the file is still locked you can use a program like Lock Hunter
Check to see if you have a Debuggable attribute in your AssemblyInfo file. If there is, remove it and rebuild your solution to see if the local variables become available.
My debuggable attribute was set to: DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints which according to this MSDN article tells the JIT compiler to use optimizations. I removed this line from my AssemblyInfo.cs file and the local variables were available.
In Visual Studio 2012:
Go to the project properties -> Debug -> Uncheck "Enable the Visual Studio hosting process"
I had the same issue. Tried all the above and found I also had to delete everything inside {PROJECT_ROOT}\bin\Release\netcoreapp2.2 and {PROJECT_ROOT}\obj\Release\netcoreapp2.2 for my project. Its definitely releated to publishing because although I use Deployment tools / bitbucket on my Azure Web App, I did try the Build >> Publish >> Publish to Azure because I wanted to inspect which files were actually deployed.
I have been using Visual Studio 2005 and 2008 and i have noticed that sometimes when i place break point in my code that it does not want to go to the break point. So i restart my PC and then it works again. Its like something get's stuck? Does this only happen to me???
How can i prevent this! It is driving me nuts!!
Thanks in advance!!
Often this is because the code you are looking hasn't been compiled since you placed the breakpoint, so you test code / unit test, is running against an outdated DLL.
This might be what's happening to you.
Check out your build manager, and make sure all the projects are checked.
Edit:
Go to Build->Configuration Manager and make sure the [Build] checkboxes are all checked, that will ensure that every project is compiled when you build the solution (Ctrl+shift+b).
It depends on if you are developing a web application, or if you have late bound code, changes in controls from another project, etc.... One way to track down problems is to look in the Debug - Windows - Modules pane, and see which assembly is actually being used. If you have remoting boundaries to cross, the breakpoint won't become active until the code is executed. If you hover over the breakpoint when it is not coloured in completely and has that question mark, you can also get more information.
Hope that helps.
I had the same problem with VS 2005.
Apparently Visual Studio's setting were corrupted. I reset them from Tools/Import and Export Settings/Reset all settings. It's now breakpointing fine.
Mike
Instead of rebooting your computer try selecting build -> rebuild solution and then running in debug mode. That usually seems to clear out little annoying things like that.
There's a hotfix for various debugger problems in VS 2008 SP1, have you tried that?