Remote Debug Windows Forms project - c#

I have simple one Windows Forms project with one Main form in Visual Studio 2013 Update 4, on my dev Windows 8.1 Pro PC. I also have second computer (name: REMOTEPC) with Windows 8.1 Pro and installed Visual Studio Remote Debugging Monitor 2013 Update 4. I have configured Windows Authentication and firewall settings. I have configured project properties for Debug to use remote machine to REMOTEPC:4018 and in logs I see that user REMOTEPC\username connected. I use same local and remote paths (C:\proj\bin\debug\myprogram.exe) and have manually copied all files from directory.
Now I got error:
Error while trying to run project: Unable to start program (C:\proj\bin\debug\myprogram.exe). The MSCSMON.EXE does not appear to be running on the remote computer.
As I understand it needs only one TCP 4018 port and can not find a mistake. I have read MSDN info about this, but can not figure out why its not working. Is the remote debugging for Windows Forms or WPF possible at all ?

The solution is to use to configure firewall / port forwarding if needed, for both TCP 4018 and TCP 4019. I was missing one port (4019) and now it works without a problem.

Related

Visual Studio 2019 Debugging does not work when VPN is connected

OS: Windows 10 (with current latest updates)
IDE: Visual Studio 2019 v.16.4.4
Visual Studio cannot debug an ASP.NET Core 3 web application when the computer is connect to VPN (via Cisco AnyConnect Secure Mobility Client). The web application is dockerized and is started via docker-compose.
As mentioned here the issue must have been resolved by now; however, at least on my end, it is not resolved yet.
I have tried setting up remote debugging following this, this, this, and this documentation/suggestions. However, neither help debugging my web application when the computer is connected to VPN.
I need to keep the computer connected to VPN because the application requires data that are available via my institute's VPN.

Remote Debugging .Net Core 2.0 on Windows 10 IoT

I've written a Hello World console app in .Net Core 2.0 using VS 2017 and deployed the Debug build to a Raspberry Pi 3 running Windows 10 IoT. I can execute the app remotely via PowerShell and everything seems fine.
Having installed the Visual Studio 2017 Remote Debugging tools, I'm now trying to hook up the Remote Debugger so as I can step through my code on the Pi and I'm running into problems.
When I try to "Attach to process" from the Debug menu in Visual Studio and enter the IP and port number supplied by the IoT device portal I get the following error:
Unable to connect to the Microsoft Visual Studio Remote Debugger named '192.168.1.139:8116'. Connection request was rejected by the remote debugger. Ensure that the remote debugger is running in 'Windows Authentication' mode.
The following screenshot of the IoT Device Portal shows both the IP and Port for Remote Debug and the fact that my app (echo.exe) is running:
I've tried running the remote debugger both with and without the "Run as DefaultAccount" option checked, but this seems to make no difference.
I've also checked the firewall settings on my dev PC to ensure that it is not blocking traffic (I am connecting over the Private network)
Although the error message warns about Windows Authentication Mode, I can find no such setting for the remote debugger. Any help in getting the Remote Debugger attached and operational would be gratefully received.
You may need to select the connection type to "Remote" instead of "Default".
It works for me. You can have a try and feel free let me know if there is any problem.
One thing that I think it could help is when deploying the app to the Remote Machine and you are presented the ‘Remote Connections’ dialog you can choose there what type of authentication you want. One of the options is Windows Authentication. Try deploying and running the app like that and then the Remote Debugger should work.
In your VS Studio Project Properties -> Debug Tab -> Authentication Mode: Window Authentication

Universal Windows App Debug on Device Not Working

I'm trying to deploy and debug a UWP app onto a physical device. The Device is an Acer Iconia W1-810 Tab 8 running Windows 10 Home. The development environment is also Windows 10 running VS2015 Community. The Acer is set to Developer mode and the screen is unlocked.
According to my reading of this article I should be able to connect the device via USB and deploy and debug directly on the device. At first I couldn't get the PC to see the device as Windows Phone IP over USB Transport (IpOverUsbSvc) was disabled. Enabling that means I can now see the table on the network under the Phones category.
The project in VS is also set to Uninstall and then re-install my package ...
Selecting Device as the debug target in VS yields this error:
DEP6200 : Bootstrapping failed. Device cannot be found. 0x89731810:
Deployment failed because no Windows Phone was detected. Make sure a
phone is connected and powered on.
Selecting Remote Machine as the target device yeilds:
Error: Unable to connect to the Microsoft Visual Studio Remote
Debugger named '192.168.0.7'. The Visual Studio 2015 Remote Debugger
(MSVSMON.EXE) does not appear to be running on the remote computer.
This may be because a firewall is preventing communication to the
remote computer. Please see Help for assistance on configuring remote
debugging.
Which is understandable as I don't have this installed at the moment. But from my understanding the first scenario should be working and I'd rather not install a debugger on device unless absolutely required.
What do I need to configure in order to get the first debug scenario working?
It sounds like you might not have installed the visual studio remote tools on your target machine. You need to do that first before you can do any remote debugging.
Here are the instructions:
Download the Visual Studio Remote Tools from one of the links provided at https://msdn.microsoft.com/en-us/library/y7f5zaaa.aspx
Install the remote tools on the target machine
Start the remote debugger on the target machine
From visual studio click on small lack the arrow to the right of the debug button, and make sure "Remote Machine" is selected
When prompted, enter the IP of the device that you want to debug at.
(It sounds like you already know steps 4 and 5, but I included them for completeness)

Enabling remote debugging in application

I use remote debugging in visual studio 2012 by using msvsmon.exe on the remote pc, but is there a way to merge this in the setup of the application so I dont have to add the folder to the remote pc and run the app and change the options. Now I know that I can embed it in the installer and run it from my application, but how do I set the options from my application, like the Autehentication mode.

Windows service only gets called when Visual Studio is attached to process

I've created a simple windows service in C# using Visual Studio 2010. It uses a TcpListener and socket to listen for messages on a given port. This worked absolutely perfectly when my laptop had Windows Vista on it. However, since upgrading to Windows 7 and re-installing my service it only responds if I'm attached to the process and debugging in Visual Studio 2010 - at which time it behaves as expected.
I've tried running the service under my (administrator) credentials and setting the exe to run as administrator. I've also checked "Allow service to interact with desktop" when it was running under the Local System account.
I'm testing using both a test console app and an Adobe Air application - both with the same results.
Are there some specific permissions that I need to allow the service to be called?
Try adding an exception for your executable in Windows Firewall.

Categories