Windows User Mode Debugger Transport for Visual Studio 2012 - c++

I read a post about Visual Studio 2012 being able to support Windbg commands in the immediate window. This requires that one chooses the "Windows User Mode Debugger" option while choosing the Transport under "Attach to Process" option.
While this seems to work for the local host qualifier, I am interested in knowing if i can debug a remote target process using this method just like we do by selecting the remote transport.
I am using Visual Studio 2012 Premium.
I tried giving the IP of the machine in the qualifier section with the "Windows User Mode Debugger" transport selected but i got the "Could not connect to the machine" message.
I also tried the steps mentioned in this link:
http://msdn.microsoft.com/en-us/library/windows/hardware/hh439381(v=vs.85).aspx
but it did not work.
Also , i'm not sure if this article is meant for a different version of Visual Studio since the button that i see next to the Qualifier field is named "Find..." rather than "Browse" as the article mentions.
Can someone please help me with the right steps here?

Have you run dbgsrv.exe in the remote target machine.
Step#1:
Install Windows SDK in the remote target machine
Step#2:
Run command:
cd C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86
dbgsrv.exe -t tcp:port=12346
Step#3:
As you said, refer to:
http://msdn.microsoft.com/en-us/library/windows/hardware/hh439381(v=vs.85).aspx

This doesn't seem to be documented and I struggled with this myself a year or so back, but the WinDbg integration is Visual Studio is for what's called the smart client way of debugging. You need to run dbgsrv.exe on the server and then you'll be able to connect.
See more information about dbgsrv.exe etc. here: Process Servers (User Mode) and especially here: Activating a Process Server.
I wasted hours on this.

Related

Remote debugging(c++) with visual studio code

I searched for how to open and edit file located on remote server via local visual studio code(IDE). But I also wanted to do remote debugging, which means I will control the gdb command(via GUI)from the IDE instead of terminal.
I checked this link, but it is for node.js.
Can someone help me with this.
I use GDB extension for Visual Studio to debug my applications on remote linux machine.
Check out : extension
For reference See: link
In case you are developing apps on linux you may want to see the Linux workload from visual studio installer.

Visual Studio 2017 debugger fails connected to a ClearCase mapped drive

I'm using Visual Studio 2017 with a ClearCase dynamic view connected to a mapped drive.
Starting a debugger session fails with:
Unable to start program filename.exe.
Operation is not supported.
Unknown error: 0x80070057.
Using a ClearCase snapshot view, the debugging session works as expected, without error message.
Visual Studio 2013 works perfectly fine with a snapshot or dynamic view.
Any help would be appreciated.
It depends on your exact ClearCase version, as seen in this PI45450 (project issue, similar but not identical to your case)
PI45450: RUNNING AN .NET EXECUTABLE IN A DYNAMIC VIEW FAILS WITH RUNTIME ERROR SYSTEM.ARGUMENTEXCEPTION 0X80070057 (E_INVALIDARG)
Recommendation:
Running the executable by specifying its fully qualified UNC
pathname may work, such as
\\view\viewtag\vobtag\<application>.exe
In your case, with Windows:
m:\viewtag\vobtag\<application>.exe
See if the full path (M:\...\<application>.exe) works better with Visual Studio 2017.
Or try and upgrade ClearCase if possible (8.0.1.10+).
There is a new ClearCase APAR for this behavior, because it was initially reported only if the CC VS 2017 integration was installed. It actually doesn't need the integration, at least not on Windows 10 with UAC on. The APAR is PI86014, but it may not be visible yet as it's really new.
The issue is specific to Visual Studio 2017, Visual Studio 2015 will open and start the debug session fine, and the debug executables load just fine from a dynamic view.
The integration released in the technote seems to be a little buggy. Perhaps the one in 9.0.0.5 and 9.0.1.1 will behave better.

Unrecognized error occurred in the Windows Web Services framework

I'm trying to build and run a simple project in Visual Studio 2017 (C++) in x64 using the Local Windows Debugger. However every time I try to run it using the debugger I get this error.
This error doesn't show up when I change it from x64 to x86, but I need it to compile to x64. This has happened on both computers that I've tried it on, and seems to happen in every one of my projects. I've tried reinstalling Visual Studio already and nothing's changed. I've tried adding 'devenv.exe' as an exception to the Windows Firewall but no changes there either, even when I disabled the firewall completely. My antivirus isn't affecting it at all either: still happens when I disable it.
The application runs fine when I find it in the explorer and run it manually but then I don't have any debugging tools.
What am I doing wrong here, how do I make it build and run my project as x64?
I get this error every time I have an active VPN connection. If you use a VPN, try disconnect and see if the error disappears.
If you want to use a VPN, the solution (assuming you have Visual Studio 2017 Version 15.7 or later) is as follows:
Go to the Windows Start Menu and launch the “Developer Command Prompt for VS 2017 Preview”
Run: "%DevEnvDir%vsregedit.exe" set "%VSINSTALLDIR:~0,-1%" HKCU Debugger UseAnonymousPipes dword 1
Restart VS if it is already running
That solution is from this link to Microsoft.

Unable to start VS2012 Profiler

I'm trying to start a performance profiling session in Visual Studio 2012 RTM on Windows 8 PRO 64-bit for a console program (ANALYZE / Start Performance Analysis).
I get a popup message informing me
Could not load file or assembly 'Microsoft.VisualStudio.PerformanceTools.CounterInfo.dll' or one of its dependencies. The Specified module could not be found.
Apparently this can happen under VS2010 after KB2645410 is installed. I carefully followed the procedure given for this issue with the same error message:
Visual Studio 2010 SP1, KB2645410 and Add-Ins
However, that does not resolve the issue.
I have tried running VS2012 as Administrator as well.
How can I get the profiler working?
UPDATE
I can actually attach to a running instance of the project from the command line using the steps here:
Walkthrough: Command-Line Profiling Using Sampling
However, Visual Studio does not open the resulting .vspx file (it just does nothing after I open it with File / Open File).
UPDATE 2
Fuslogvw reports two binding errors when I attempt to start the profiler:
VS 2012 Profiler Binding Errors - Pastebin
Adding the following to the system path resolved the issue for me permanently.
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools
Some other answers may be appropriate to other situations.
Note that you probably will need to run Visual Studio as Administrator for profiling to work correctly.
I also struggled with that issue.
I found a working solution for me:
I opende the XXX.sln file using notepad.
There i found several parts in the Project and Global Section looking something like this:
ProjectSection(SolutionItems) = preProject
Performance1.psess = Performance1.psess
EndProjectSection
I removed all of them and that made my Analyzer work again.
I delete the .suo file and everythings works correctly now.
The same question exists here:
http://social.msdn.microsoft.com/Forums/en-US/a6487155-980c-4bc8-82de-2fe588fdf37f/windows-update-kb2645410-and-performance-tools-error
The following are suggested workarounds:
Remove windows update KB2645410
Only run one instance of Visual Studio
If you are the administrator on your development PC you can add the permission to Everyone to read and execute all the content in the folder "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Performance Tools" and subfolders/files.
"I backed everything up and did a complete repair of Visual Studio using the original disk from Microsoft. That allowed the computer to shut down normally. Then I tried the patch again. It hung again, but after a few reboots we got a message about deleting corrupt files and finally everything seems OK."
My issue was resolved when I realized that my user access control was set too high. Once that was turned off, I rebooted and it all worked great.
Once I uninstalled re-sharper my issue was resolved.

Debugging x64 programs locally without being administrator

For the past several years I have been logging into my PC as a limited user and debugging applications this way. Now that I'm making the move to x64 bit applications, I'm unable to do this and get a dialog error as shown below. Of course this is not the real problem as the service is running just fine. If I log off and log in as admin I can debug normally just like I do for a 32 bit process.
Since x64 debugging is currently making use of remote debugging techniques, does anyone know a way to do this without being administrator?
VS2008 Error:
Unable to start program
"C:\PathToDebug\my.exe"
Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) failed
to start. Verify that the remote
debugger is properly installed.
!!! EDIT !!!
Sorry, I found the error. I use a very secure environment, LUA + SRP, and for some reason an additinal rule must be added for "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe" All is good now.
Sorry, I found the error. I use a very secure environment, LUA + SRP, and for some reason an additional rule must be added for "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe" All is good now.
It's a strong possibility that the x64 program was not installed for "all users". When performing the installation, sometimes you see this option before installing the files. This is likely not related to x64 architecture but instead a file permissions error.
When installing applications it's best to install as the ADMIN and enable it for all users first. Then as a limited user there are no file permission errors.