The Solution that we work on here includes 1 project in C# and another project in C. Is there any way to debug c code in Visual Studio?
Of course, if you have the source code, create a project from it, compile as debug (add breakpoints, watches...) and do the debugging.
Related
I try to debug the External dll using visual studio code itself.
IF It's Possible in visual studio code.
Example:
Dll path:..\..\..debug\x86\test.dll
Thanks.
When i hit the dll, debugger engine to redirect the visual studio code project solution and hit the debugger line. Simailr to visual studio.
I have resharper intellisense for C# and C++, a C# solution is nested in a cmake project, when I open the cmake project the C++ intellisense works, then when I open the C# solution the C# intellisense works too but when I go back to the cmake project the C++ intellisense does not work any more. For switching between projects I'm using the Switch between solutions and available views button.
how to avoid this behavior?
one more thing the folder name on the VS top bar changes when entering the VS solution but not when going back.
This is a bug, I've filed https://youtrack.jetbrains.com/issue/RSCPP-32523 to track it.
Is there a way to step through MonoGame source code while debugging (like with the .NET Framework) without having to compile MonoGame myself? I am using Visual Studio 2013.
No. Visual Studio requires a successful compilation to enable stepping through code.
My setup:
Application.exe (Visual Studio 6.0 C++)
Component.dll (Visual Studio 2010 C#)
Application.exe uses Component.dll
I want to be able to debug my Visual Studio 6.0 C++ application and the Visual Studio 2010 C# component that it uses at the same time but I'm not sure if this is possible or not.
I tried to launch the application from Visual Studio 6.0 and attach to that process (Application.exe) in my Visual Studio 2010 component solution but when I go to attach to the process (Application.exe) it is greyed out. I tried switching the Attach To: to Native but this does not allow me to attach to this process. My Application.exe is still greyed out in the window.
Is it possible to do this and if so how?
There can be only one debugger attached to a process, that's why the selection is grayed out. You have little use for the VS6 debugger, it doesn't know anything about managed code. You'll have to debug this from VS2010. Right-click your C# project, Properties, Debug. Select "Start external program" and select your C++ .exe. Tick the "Enable unmanaged code debugging option".
Set a breakpoint in your C# code and press F5 to start the .exe. The breakpoint indicator will turn solid as soon as the C++ code loads you DLL. Debugging the C++ code might be possible too although you're working with a .pdb from the previous century. You cannot single-step from the managed code into the C++ code, you have to set a breakpoint.
You cannot attach two different debuggers to the same process.
Instead, you can attach it only to VS2010, but attach it as both managed and native.
I have an old DLL written in Visual Studio 6 which I am calling from C# written in Visual Studio 2010. The DLL is not working properly and I want to debug into it. How can I do this? I have the source code project but cannot see how I can step into it.
Note: When I say "doesn't work", the call to the DLL succeeds and it gets a little way through the code in the DLL before failing, but I want to track down exactly where.
The technique of debugging a DLL is described here on MSDN. You'll need to do this from Visual Studio 6 (i.e. the tool that developed the DLL) and so the terminology will have changed. But the principles remain the same.
Attaching VS6 debugger on the .NET process shall work, as long you have the PDB file with the corresponding binary and the sources. You can break only on DLL code, however.
Attaching another VS+ shall work if the flag "Allow unmanaged debugging" is checked, but there is a possibility that symbols are not loaded by the debugger. A recompilation of the DLL shall solve the last problem.
Open Visual C++ Dll project, set breakpoint where you need. In the Project properties, Debug, Executable for debug session, type .NET executable file which uses this Dll. Start debugging (Go). When VC++ function is called, debugger breaks. Using this way, you can debug only unmanaged VC++ code.
Another way is to start debugging from .NET client in mixed debugging mode. Add VC++ project to the solution and rebuild it to debug both managed and unmanaged code.