In Visual Studio 2010, I'm using Remote Debugger to debug my program. It's weird that F10 works and steps over code lines, but no breakpoint is hit. Running the program by F5 causes the program to run neglecting all breakpoints.
why?
Related
I keep getting this error the first time I try to run my program (debug mode) from inside Visual Studio 2015.
So what happens is I'll hit the Start button to start debugging, and it gives this error. I close the dialog, then try it again and it works. It happens every time.
Any suggestions?
I downloaded Visual Studio Community 2015 to try and lean F#. My F# projects compiles without any issues but when I try to launch the console project (even the default console project) Visual Studio just hangs and then freezes. The only way I have to shut it down is to go to the task manager.
Same thing if I try to directly launch the generated .exe file: explorer freezes and I have to go to the task manager to restart it.
All my C# projects work fine...
I have seen a similar behavior before on a machine that had an anti-virus installed. The anti-virus was blocking Visual Studio from running F# code with debugger and disabling the anti-virus resolved the issue.
In general, there are a few ways to run F# code in Visual Studio:
Using F5 to start the program with a debugger (this is the one that the anti-virus was blocking); F11 which steps into the debugger was also not working
Using Ctrl+F5 which starts the program without a debugger - this should work!
By creating an F# script file (Script.fsx), selecting code and using Alt+Enter to run code using F# interactive - this should work too.
Many people do quite a lot of work with F# using F# Interactive, so learning how to use that is a good skill, but to use the debugger, disabling anti-virus should do the trick.
Well I want to debug my .dll which gets loaded into the process, and it's crashing somewhere. I tried to log which line gets executed last to a file but that din't help much.
Now, when I attach the debugger and the application crashes, MSVC debug freezes the proccess, making it impossible to alt tab to any other window and I'm stuck at a black screen with only Task Manager working. I tried shutting down the applications process, but it's impossible, then I had to shut down visual Studio - left without any clue what could cause the crash.
How can I effectively and without problems debug in this situation?
(remote debugging is not an option, I have no second machine at disposal, and I have no second screen too)
As you know Visual Studio is an IDE and windbg is just a debugger.
I always browser code in visual studio and copy the method name then paste to windbg to debug.
I wonder could I set breakpoints in vs and then start windbg and it'll use the bp list in vs?
Not really, the problem is that when the bp is hit it raises an exception that the debugger quietly grabs and compares to it's list of known breakpoints. While it might be possible to have both debuggers attached, it would probably be a toss up of who got the exception first, also attaching two debuggers to the same process can cause odd behavior.
You cannot set breakpoints from both Visual studio and WinDbg, there can only be one debugger that is attached invasively.
You can attach invasively with Visual Studio and attach non-invasively with WinDbg but both cannot attach invasively.
Similarly if you attach invasively with WinDbg you cannot attach invasively with VS, the option will be greyed out for your exe.
what is the difference between start Debugging and Start Without Debugging in Visual Studio while running a program ?
The first option starts the program under the control of Visual Studio's debugger. The second option starts the program stand-alone. Some of the practical differences while debugging a process are:
You can pause, resume, stop and restart the debugged process from Visual Studio.
Breakpoints defined in the code will be active for a debugged process, and the debugger will pause the process and show a stack trace whenever the process hits one of them.
You cannot exit Visual Studio without stopping the debugged process.
When a debugged console process exits, it will display a termination message until you press a key. This allows you to inspect the output of a just-ended process without having the console window immediately disappear on you.
The former attaches the debugger, the latter does not. You use the latter if you want to run in the same way an end user would.
the answer seems obvious, especially if you just try it :)
"Start without debugging" starts your app but doesn't attach visual studio as the debugger. "Start debugging" starts your app, with visual studio attached as the debugger.