VS2010 Access Violation while step the code using F10 or F11 - c++

I have a C++ native code that run fine in Debug and Release mode. But there is a little problem, if I debug my program and set a breakpoint in my code visual studio stop on breakpoint then if I press F5 to continue run code run normally but if I press F10 or F11 visual studio catch an AccessViolation and program will be stopped due to the fact that exception is not anywhere in my code and I don't handle it.
This error will not occure in Console application but in MFC application or when I use a .NET EXE to debug my native DLL.
I have a 64 bit Win7 and VS2010 SP1.

Sorry!! I found a solution, you must turn off Tools/Options/Debugging/Native/Enable RPC debugging.
and every thing will go fine. But I don't know if I want to debug RPC calls to external server, what should I do, so if any one help me and find the reason of failure it will be great

Related

Why does a program that is getting debugged in Visual Studio take focus and not allow me to alt-tab back to VS?

I am trying to debug an application and look at the code while a test runs, but while that test is running the focus is forced on only the application. I can't alt-tab from it back to Visual Studio, because it forces back the focus. How can I look at the code and allow a test to run without it taking focus? This is in C++ and this is not an instance where a breakpoint is being hit

Visual Studio 2015 freezes when debugging a cpp code

I've installed Visual Studio 2015 Enterprise. I'm trying to create a c++ OpenGL project, however, it always freezes when I'm debugging(ctrl + f5). I've tried to write a simple program that prints text to the screen and it still freezes. The build completes successfully, projects in C# don't freeze as well. When I'm trying to run the cpp project VS freezes completely and I have to kill the process, running the .exe directly freezes the explorer..
I haven't found any solution to that kind of problem in the web, and I was hoping that someone here will know what to do..
Thanks :)
Try setting a breakpoint on the very first line of your main, click on debug and see if it gets to the breakpoint. If it does, try stepping through until you see what is causing your freeze.
I had exactly the same problem as you. Turns out my Avast anti-virus was causing the issue. I disabled it and now it's working.
I found the answer from this question:
Visual Studio 2015 freezes when finished building

Visual Studio 2013 debugging access issue with breakpoints

I've been having an issue with debugging my C++ programs recently in Visual Studio 2013. Normally my programs will run fine, however, when I include a breakpoint at the end of my code in order to keep the console open, I will have to manually stop the debugging of the program afterwards (Shift + F5), which will consistently cause an error saying "The debugger was unable to terminate one or more processes: [4912] .exe: Access is denied. The debugger may be unstable now. It is recommended that you save all files and exit." If I go on to continue coding and then compile again later, it will fail to compile with the error that access is denied with fatal error LNK1168, saying it cannot open the .exe for writing. This only happens when I include a breakpoint in my code, so I'm wondering if there's a fix for this, or something that I'm doing wrong? Thanks.

Visual Studio 2013: native C++ single-step debugging (F10) slow

I am using Visual Studio Premium 2013 Update 2 on a freshly installed (fast) machine with Windows 8.1 Update. Everything is running smoothly, only one thing bugs me:
Problem
When I debug a native C++ project (debug build) by going from line to line with F10 ("step over") it takes 1-2 seconds to go to the next line when I press the F10 key.
What I tried
I looked at several other questions related to slow debugging and made sure that neither of the following is not the reason in my case:
Everything is local (app and all data), no network shares involved
Disabling the Microsoft symbol server did not help
I only have a single breakpoint
Using the menu/toolbar instead of the keyboard does not make any difference
In the default configuration "edit and continue" is enabled, but apparently not for native code:
When I disabled "edit and continue" completely, F10 stepping became much faster (0.5-1 s). The speed is tolerable now. I had to restart Visual Studio after I changed the configuration to this:

What is different between visual studio F5, ctrl+F5, or running outside of visual studio?

I have written a program in vc++ that has different behavior in various case as below.
When I run it by F5 it works properly in release mode.
When I run it by ctrl + F5 it crashes when I start to send data to the program.
Outside of visual studio it crashes immediately.
I don't know how to find the bug. Any idea on
what is different between these cases?
Running ctrl + F5 will run the application without debugger.
(http://msdn.microsoft.com/en-US/library/8b59xk0f(v=vs.90).aspx)
This is not the same as running in release mode.
You can run your application in debug mode but without debugger.
It sounds stupid but is for example helpful if you want to stop the console from closing on exit. (How to stop console from closing on exit?)
You need to understand the difference between running an application in debug mode and release mode. F5 will generally help you to debug the application and ctrl + F5 will execute the application. There might be some issues in release mode that makes your vs to crash. Read this to get an understanding.