How do I remote debug a vsto outlook addin? - visual-studio-2010

I have built an outlook addin, and I'd like to remote debug it running inside a vm on my dev machine (the vm is xpsp3 x32 and outlook 2010, my dev machine is 7 x64 with outlook 2007)
I have (after quite a bit of messing about with user accounts etc) got remote debugging working between vs2010 and the virtual box vm. I can attach to a simple test application and set breakpoints, and they get hit.
However, I can't seem to do the same with the outlook addin. I can't just attach to the outlook.exe process running on the machine as that does not seem to load the addin modules so the breakpoints never get hit.
I can't figure out how to get VS2010 to start outlook on the remote machine from a locally built project, I tried to follow these msdn docs but the instructions to set the working directory don't seem to work, so if I set it as the example suggests and start debugging it comes up with a message saying that the folder does not exist.
If instead I set the Start Action in the debug properties for the outlook addin project to 'Start External Program' and point it at the outlook exe, then VS2010 will successfully start the app, however, the breakpoints are not hit, even though it seems to indicate that they have been successfully set.
Has anyone been successful in remote debugging vsto addins? What am I doing wrong?

I know this is quite an old question, but just in case someone comes across this post, here is a solution:
On the host machine, in the VSTO project, add this at the top of the startup method.
MessageBox.Show("Debug");
Deploy the add in to the remote machine, open Outlook and the MessageBox should display
Run the Visual Studio Remote Debugging Monitor on the remote machine
On the host machine, set a breakpoint on the line after the MessageBox
In Visual Studio, select Debug/Attach to Process from the menu and attach to the Outlook process running on the remote machine
On the remote machine, click on the OK button on the MessageBox you added in step 1
The breakpoint you set in step 5 will now be hit

Related

How to identify which process runs my website under IIS 6.0

I need to know which ID process I need to attach to debug my website remotely. My website is hosted on a virtual machine with Windows Server 2003 and I am debugging with Visual Studio 2010.
W3WP process was the name expected on my task manager, I think I am missing something.
Can anyone advice me on this?
These are all the process with that start with 'w'
Also I tried to add dllhost.exe, but when I put a breakpoint it says that the table symbols is not loading properly. Do I need to attach a .pdb file?
To see the IIS process running, you need to open a browser and search the url that is publish. Otherwise the process will not run and you will never see it on the Task Manager. This is different for Windows Server 2008, there the IIS process is running all the time.

How can I find out what debugger is attached to w3p.exe

I'm trying to setup debugging on a class ASP project in VS 2010, and in doing that am trying to attach it's debugger to w3p.exe. I'm using Windows 7 64-bit and IIS 7.5. I've used this method successfully a few times before on another machine.
However, I'm finding that this time I am unable to attach the debugger. It's saying:
Unable to attach to the process. A debugger is already attached.
But I can't figure out what it might be. How can I determine this? Or could it be something else? I've rebooted my PC and can't yet see signs of anything running which looks like a debugger.
Setup
In case it helps, here's the steps I used to setup the environment, which I documented from my previous successful attempts:
Created new empty Visual Basic .NET Web (Best to create in C:\inetpub\wwwroot\, otherwise you will have security/ACL issues when loading the site).
Copied the contents of site folder to project folder.
In solution explorer, selected to show all files not in project. Selected all files and right click and select: "include in project".
Under project properties -> Web -> Set to use IIS and start with URL http://mysite.local
In hosts file pointed mysite.local to 127.0.0.1
In IIS setup new website pointing to the files with a host header of mysite.local
Go to application pools, ensured mysite.local was set to classic mode. No managed code.
Under ASP -> Enable Parent paths and make sure server-side debugging is enabled
Under error pages, make sure full details are shown.
Debugging in Visual Studio 2010
Run VS 2010 as Administrator
In your project, use Ctrl+F5 to run without debugging
Now, in the menu go to Debug -> Attach to Process -- This is where I fail
Tick show processes from all users AND show processes in all sessions
Make sure it is set to automatically determine type of code to debug
Look through the w3p.exe processes in the list, and based on the IIS POOL\site name, pick the right process.
Set your breakpoints and refresh -- debug as normal.
Are you having some Debug Diagnostics Tool running on your machine. Sometimes back i had the same problem the Debug Diagnostics Tool was debugging my w3p process.

VS2012 Publish Web Wizard

I am using Windows Remote Desktop (RDP) to connect to my office computer via a Cisco Gateway. In VS2012, my project is open and I clicked Build/Publish Web menu. The Publish Web wizard window flashed for a second then disappeared. It seems to go behind the main VS2012 and made the main VS2012 go into modal mode. It does not respond to any mouse or keyboard commands. I had to use Task Manager to kill it then relaunch it to regain control. This doesn't happen when I am in front of my office computer. I can see the Publish Wizard in front of the main VS2012 window. This doesn't happen to my coworkers who are also telecommuting via RDP. I tried to look up VS2012 log, but there is no such a log file on my computer. Windows Application Log doesn't say too much either. There are 2 devenv.exe *32 in the Task Manager Processes tab. I killed the one with smaller memory size. It still wouldn't make the main VS2012 come out of modal mode. Please help. Thanks.

Configure Visual Studio 2010 Remote Debugger

I have installed the Visual Studio 2010 Remote Debugger on a Windows Server 2003 (x86) server, and am attempting to connect to it results in the following error:
Unable to connect to the Microsoft
Visual Studio Remote Debugging Monitor
named 'ServerName'. The Visual Studio
Remote Debugger on the target computer
cannot connect back to this computer.
A firewall may be preventing
communication via DCOM to the local
computer. Please see Help for
assistance.
I have checked my Windows firewall setting, and ensured file sharing is enabled on my local machine. I have ensured that DCOM is running on the server, as well as the debugging service. There are no actual firewalls involved that I know of.
What else do I need to change to get this to work?
I just ran into connectivity issue. The problem was the Client PC (my desktop) could connect to Remote Host running debug monitor, but the Remote Host could not send data back to my desktop.
Turns out that it was caused by the 'Profile' setup in Windows Firewall. The Firewall rule was being limited to 'Public' profile - but my desktop was connected to the local domain. Changing the setting to 'Domain' ensured the Remote Host could communicate debugging data back to Client desktop.
Check under Windows Firewall -> Inbound Rules -> Microsoft Visual Studio -> Advanced Tab.
Cheers,
J
Here are the steps I took to get remote debugging to work against an ASP.NET app. Not sure if you've done this already, hopefully something might help.
On my machine (call it DEVMACHINE from now on) I shared out the folder that contained the remote debugger (msvsmon.exe). On my machine, it was located at C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x86. I called the share msvsmon
On the server, I opened Windows explorer and navigated to \\DEVMACHINE\msvsmon, and ran msvsmon.exe (This opened the Visual Studio Remote Debugging Monitor)
On DEVMACHINE, I started Visual Studio 2010 and opened the solution that represents the application I'm attempting to debug.
In Visual Studio, clicked Tools > Attach To Process...
Entered the server name in the Qualifier field, then double clicked on the w3p.exe process that was in the list.
I then placed a break point in the location I wanted to start debugging
Couple things to note: The code deployed to the server was a Debug Build, the pdb files were there, along with the binaries. I had full admin rights on the server. No tools were installed on the server, I simply ran the exe that was located on DEVMACHINE. I did not have any firewalls between the DEVMACHINE and the server. And, both DEVMACHINE and the server are on the same domain.
Hope that helps.
I kept getting the same error listed above, and after trying all of the other answers, the problem turned out to be that DCOM was disabled on my development machine. The problem was solved by enabling DCOM using the instructions from this technet link.
I am using local DNS so I can test websites before they go live (by editing my hosts file).
I have a specific IP assigned by my router at home and at work.
i.e. dev.example.com is mapped to 192.168.1.123
When my machine changed to a different network without me realizing it could no longer reach the debugger and so I got the error.
Pretty obscure situation I had to get this error, which no amount of rebooting or recycling IIS will fix.
I had the same problems with the debugging service. The debugging service was starting automatically but I could never connect. I even turned off the firewall completely and that didn't help either.
Try running the debugging monitor (as opposed to the service) and connecting to that. You can find it in the start menu.
Confused about the difference between the monitor and the service? So was I. See http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/afc80afc-c8eb-4831-915a-1edb8d188f98
Same problem here. My reason was that Trend security was enabled in the local computer, and it was blocking the firewall. I could not stop it because I needed a password, so I just deleted all the Trend processes, and it seemed to work fine. So you could check if some antivirus is enabled that is blocking the access.
I also needed to add devenv.exe to the Allowed Programs in the Windows Firewall in the local computer, and set its policies.
Below is a quick step to set up Visual Studio Remote Debugging Monitor on Visual Studio IDE.
Open Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio 2010 Remote Debugger Folder.
A Windows Explorer shows the 32 and 64-bit versions of the Remote Debugging Monitor.
Copy the respective ver that matches remote server (e.g. x64 machine use X64 folder & x32 machine use X86 folder) to a folder on
your machine.
While at the console on your remote machine, go to the folder and start msvsmon.exe.
Go to Tools > Options and change the Authentication mode to No Authentication and check the box Allow any user to debug.
From your development machine, on Visual Studio, go to Tools > Attach to Process.
Change the Transport to Remote and the Qualifier to the name of your remote server.
You should now see the executable, which you want to debug on that list. Select the process you want to debug and click Attach.
You may now debug the code while it is running on the remote server.
Just remember to turn off Remote Debugging Monitor at the remote server once done.
Please refer below MS link:
https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-cpp?view=vs-2017

VS2010: "Unable to start debugging"

My VS2010 debugger has stopped functioning suddenly today on my Dell M4500. I had reinstalled VS2008 SP1 last week, but the 2010 debugger ran fine since then, so I'm not sure its the culprit.
I can launch a project once just fine, & afterwards I get a message that reads "Unable to start debugging," without any error # or explanation of why. Doing IISRESET doesn't help, I get the same message until I close VS with the entire solution and reload it. Here are some things I've tried:
Verified I have the latest project files
Repair option for VS2010
Complete uninstall/reinstall VS2010
Replaced Web.config with known good copy
Added localhost to the list of trusted sites in IE
Performed \aspnet_regiis -i in the 2.0 & 4.0 directories
Through IIS Services Mgr -> Default Website:
verified Enable HTTP Keep-alives checked
placed check in Integrated Windows authentication
Ensured Debug on "Any CPU" is selected
Tried building to Platform targets "Any CPU," "x86" & "x64"
Added DisableLoopbackCheck registry key entry in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Tested under both IIS & VS Development web server
Does anybody have any suggestions I can also try? Any help is very greatly appreciated!
Just a side note. I got a similar error in VS2013 trying to attach to chrome the error was:
Unable to attach the application 'chrome.exe' using XXX The 32 bit
version of the visual studio remote debugging monitor (msvsmon.exe)
cannot be used to debug 64 bit processes or 64-bit dumps. Please use
the 64-bit version instead
I had to untick "Silverlight" in the web project Web section:
I received this same message, preventing my web project from running and opening in a browser. Turns out another developer had made a change in the project properties to "Use Custom Web Server" which pointed to an external URL instead of to the web server on my machine.
Try this:
Right-click your project in Solution Explorer - click Properties - click Web tab - under Servers click "Use Visual Studio Development Server". For reference the usual port value here is "Auto-assign Port". Best of luck.
Here's why I got this error.
In Debug properties, verify that Start external program is not empty.
VS 2010 will warn you about it being empty, but will let you save it
I was trying to switch it from IE to Chrome, lost track of changes I was making, and spent an hour trying to figure out where this error was coming from.
I had the same issue but it worked when I switch Build => Platform target from x64 to x86.
Kindly turned off Debug Edit and Continue option
Turn on vs2010, run debug.
turn off debug, shut down all lunched webServers (i had few of them for different services)
Turn off VS2010
Turn on VS2010.
After that everything works perfect.

Resources