I am debugging a windows application in visual studio 2010, the application was developed and upgraded from .net framework v2 and VS 2005.
Originally, windows forms could be open on debugging mode. However, several times later without editing (as I was just tracking possible bugs before fixing), those forms become unable to open. Whenever, I tracked the bugs until the code which shows the form, then the debugger will just stop tracking without any messages. Does anyone know what problems could cause this situation? Thanks a lot.
Usually if you are unable to debug step into code then this usually indicates that there is no debug information available due to missing source and/or a missing debug .pdb file for that item.
Check the build configuration to ensure that you are attempting to debug a debug build, it is easy with solutions containing multiple projects to accidentally set the configuration manager to build a project in release mode, whilst the project that you're stepping from is in debug mode.
Also in multi-project solutions check that you are referencing the project and not the project output where required, otherwise setting the configuration manager to build a project in debug mode will have no effect if you're referencing a release build output for that project.
If the Winforms reside in a third party DLL then ensure that you have referenced a debug version of the library before attempting to debug.
Related
I am attempting to debug my solution, which is set to start a few different projects. One of these projects is giving me an error when it is hit saying that it is running in release mode. This same solution has been running fine on Windows 7, but I just switched to a new machine running Windows 10 and am now getting this error message. I have attempted cleaning the solution and doing a rebuild with Debug and Any CPU selected to no avail. The code that is failing is within a class library that is referenced by a Web Api project. I am able to send a request to the Web Api that does not require the use of the class library and that works as intended.
Try opening configuration manager in visual studio and ensure that all of the projects are set to debug, I assume that some are release.
Go to
Project->Properties->Build
then Uncheck Optimize Code
As an alternative, after reading the docs here, I rebuilt once again and spotted a warning stating that some modules were optimized but that I had Enable Just My Code set. I then reverted Supress JIT Optimization on module load to its original value (selected) but de-selected Enable Just My Code. I am able to debug now
It happens to me another day that I had one solution with several projects.
Using "Add existing project" i had one library project - which is a Nuget. I wanted to debug this Nuget.
In the WebApi project that used the Nuget, I remove the reference to the Nuget and make a reference to the Class Library.
I was getting this message all the time. I did all the advices :
Mark "Define Debug Constant". Check Solution Configuration Props and check if projects are all in Debug etc...
It turns out that the Nuget was been referenced in all the other projects besides WebAPI. And I just remove it in one of my projects. This was the only and single problem :/
It happened to me as well. For me everything was in debug and still getting the error. I observed that it happened to me because, I had installed the executable on the same machine for which I was setting up the Dev environment. Uninstalling it solved the problem.
I have tried all solution above and didn't work. and I found this solution work :
Debug > Options > Debugging > General > (check) Surpress JIT optimization on module load (Managed only)
I have a solution with 4 projects, three of them are C++, and one is C#. I am trying to debug the C# one, but am unable to. Every single time I try, I get an error that says
Unable to start debugging. check your debugger settings by opening project properties and navigating to 'Configuration Properties -->Debugging'
Configuration is Debug, and the Platform is Any CPU. I am not debugging on a remote machine.
I have VS2017 installed on Windows 10.
Cannot Debug in VS2017 with Windows 10
According to the error message:
check your debugger settings by opening project properties and navigating to 'Configuration Properties -->Debugging'
This should be the debuger settings for C++ project rather than C# project:
C++:
C#:
So, first, you should make sure your StartUp Project is C# project. And for the C++ project, you can create a new blank C++ project, then compare the debugger settings of the problematic project with the settings of the new project.
Hope this helps.
My app does not run on "Release x86" when running the app it crashes immediately after the splash screen. Output shows the following exception:
The program '[8204] dfz.exe' has exited with code -1073741515 (0xc0000135) 'A dependent DLL was not found'.
It also tells me the module is build without symbols, however in build settings I have set debug info to Full.
The first time I build the app for the Windows Store it built correctly and I also published that version to the store. When I did a manual rebuild to check if ads where inserted correctly it would not run.
However, I can run the app on ARM and X64 with no problems on release. Only x86 with .Net native toolchain will throw the missing dependant DLL.
What I have tried so far:
Created a new project, Added all my files and Nuget packages, No dice
Removed and updated all my existing references.
Tried to debug the release version so i can find out what DLL is missing from the package. However it keeps telling me there are no symbol files.
I am looking for any suggestions I can try because I am really at a loss here of why it will not run on x86.
Edit:
A blank UWP project also returns the DLL error when i run it. It looks like i have a broken development environment.
Edit2:
Just did a remote debugging session to another laptop and the app worked with no problems. So the problem is an environment related issue.
Could one of the projects in your dependencies be configured specifically for x64?
Another thing to check is that one of your projects is not set to build for that configuration (I vaguely remember some problem I had years ago that sounds kind like your situation ... although not for windows store apps ... and it turned out one of my projects wasn't set to compile for the configuration I was selecting ).
I'm getting the subject error for breakpoints set on a vs 2010 website project.
When I view the modules window under Debug-->Windows-->Modules I see that it cannot find or open the PDB file for WebDev.WebHost40.dll -- it skips loading symbols for all other dlls. I tried to fix this by using Tools-->Options-->Debugging-->Symbols and checking Microsoft Symbol Servers, this fixed the cannot load symbols message in the module window, but it still wont debug and gives the same error message. I've also tried deleting the temp Visual Studio files, rebuilt the project, closed and re-opened visual studio, and also rebooted machine. Any other suggestions? Has my project perhaps been corrupted and I start fresh with a new project?
Thanks
A few things to check - in Visual studio - right click the project and go to the build tab. Make sure you are running under debug mode. Also check the debugging settings and target platform are OK. There are also adanced build settings worth checking in this tab. You mention that the pdb file isnt being created? If it is, try deleting it and then it will be recreated by VS. If it isn't there is something wrong with the build settings. I would try some changes in the build tab to see what works.
Try creating a brand new solution, if you can debug that then there's something wrong with one of your projects. You then need to work out what's different between the working project and the broken one.
If you can't debug a new project either, then at least you know it's not your project, and time to reinstall VS (boo).
I know that this question has been asked several times, and many people here have suggested different answers. Though none of them are working for me.
I created a Windows Forms application with Visual Studio and .NET framework 4.0 and added a breakpoint. However, when I debug the application, an exclamation mark appears on the breakpoint and it says..
The breakpoint will not currently be hit. No executable code is associated with this line. Possible causes include: conditional compilation or compiler optimizations.
I have tried out several suggested solutions
Cleaned the project
Deleted the pdb
Checked the configuration and ensured that it is debug
Set the debug configuration from "x86" to "Any CPU"
Tried creating project from scratch
Tried re-installing .NET framework
Removed temporary ASP.NET files
However, none of them seems to be working. I was able to debug my projects with breakpoints before and for some reason, something happened and I am not able to debug the projects any more. What should I look out for or fix to resolve this issue?
Probably your breakpoint is in a project which is not dependent on the "startup project". Implicitly these projects are not compiled on Run (button F5).
Go to: menu Tools → Options → Project and Solutions → Build and Run → uncheck first check box (only build startup projects and dependencies on Run).
I recently had this problem and it stumped me for a while. Ends up I had inadvertently switched my build configuration away from DEBUG to another configuration that was more optimized and did not "Define DEBUG constant": Project > Properties > Build > (first check box).
This may also happen if other projects in your solution are set to configurations other than DEBUG, usually accidentally, in the Solution Configuration Manager.
In Visual Studio go to the menubar, menu Debug → Windows → Modules, find the assembly your code is located in and check the Symbol state. Chances are you're having Visual Studio loading a different version not matching your PDB files.
I had the same problem here...
I was using Visual Studio 2005 - Professional Edition, and my problem was when I tried to breakpoint a Windows Forms application.
I've searched in many forums on the Internet, and I hadn't found any answer.
But the solution for this problem was easier than I had expected. Just right click on a Visual Studio shortcut (or .exe) and unmark execute in compatibility mode.
Your best option is to create a new project. Then import all the files in the previous project, including your forms if any.
You are now set to OK to continue.