Unable to connect to the remote server from Windows service - windows

When I try to connect to remote server from a .Net windows service installed on the local machine, it is working correctly, but when install the windows service in the same server where the web application is installed, it gives this error:
"Unable to connect to the remote server"

There are many possible reasons for this.
But this is a guessing game with multiple combinations of choices and paths since you did not describe the context well (which Windows, editions and versions, etc.).
One of the possible reasons is "Loopback check" security feature in Windows: http://support.microsoft.com/kb/896861

Related

Should I use a windows service?

Hi I have a console app which I need to start up when Windows Server 2012 starts and without needing to login. I've done a bit of research and people advise a windows service is the correct approach, however the links are quite old and I wanted to confirm this is still the case, or indeed correct at all. Cheers.
Yes, Windows Service is still the most popular way to write and run servers and or a 'daemon' in Windows OS.
Depending on what your application is doing, you might have other options though, e.g. hosting an application in IIS (Microsoft's Web server application in Windows Server).
More recently, Microsoft has been working with Docker to also allow the use of containerized application deployments, which is available in new versions of Windows Server (Windows Server 2016).
Here are a few resources for more reading:
For .NET developers: Walkthrough: Creating a Windows Service Application in the Component Designer
Not just for .NET developers: Quick Start: Windows Containers on Windows Server

VS2015 debugging on remote machine, Connection always fails

When follow the tutorial Run Windows Store apps on a remote machine,Visual Studio 2015 can't connect to the remote debugging tools.
VS2015 finds the remote machine, and it can be selected. However when you will try to run the application on the remote machine, the Remote debugger will simply say "Connection from XXX failed".
Neither it, nor visual studio provide any clue as to what happened.
This happens because the tutorial links an old version of remote debugger.Current version can be found at their Download Center.
Up to date guide:
Deploying and debugging Universal Windows Platform (UWP) apps.
It seems to be Microsoft's custom to have multiple, mutually contradictiong versions of the same documentation.

VS2010 remote debugging with default transport problem

I need to do remote debugging of managed code (.NET) on a server hosted on a different network. Neither the client or server is on a domain so i have to use the public ip of the server.
I'm trying to use Visual Studio -> Attach to process -> default transport with the qualifier john#xx.xx.xx.xx but it's not working.
I get the error message : "Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named 'john#xx.xx.xx.xx'. There is no server by the specified name running on the remote computer"
This error message tells me i can connect just fine but it can't find the msvsmon instance (which is 'john#WEB-001'). So i tried to use the combination of qualifiers such as WEB-001\john#xx.xx.xx.xx and xx.xx.xx.xx\john#WEB-001 but neither are working.
If I choose the transport "Remote (Native only with no authentication)" it connects just fine and I can see the process list on the server but it is pretty much useless because I can't debug managed code.
The administrator 'john' exists on both computer with the same password
Windows 2008 R2 X64 (Server)
Remote debugging component (VS2010) X64 installed
Firewall off
Msvsmon new server named 'john#WEB-001' running as john
Windows 7 X64 (Client)
Visual studio 2010 running as john
Firewall off
Any idea how to fix this, or is this scenario not supported? Thanks
having you tried putting web-001 in your hosts file, and connecting as john#web-001?
Try adding the server name to your hosts file:
192.168.1.100 WEB-001
Replace the IP with your own. Native code debugging is done over plain TCP/IP with no security but native code requires DCOM to enforce security, I don't understand the reason but ....
I know this is an old thread now but.
When the remote debugger is first installed you can set a firewall setting that allows all web traffic or only subnet connections. Run the configuration again to allow all web traffic.
Also, as the Administrator account, not a user in the Administrator group, Shift+r-click on the debugger shortcut to execute as a different user. Enter in the other user account that has the same username and password as the machine you are debugging with, in this case john.
This is the process I have to use.

step into web service on another LAN server

I'm debugging a vb.net windows program which I've upgraded to a VS 2010 solution, targeting Framework 2. I need to step into a webservice's code. The web service is framework 3.5, also vb.net, running on a windows 2003 server on our LAN. I've seen a ton of crap on the Net about it, mostly other people who couldn't get it working either.
The error I get in VS2010 is the exact same one I got before upgrading the project from VS 2005:
Unable to automatically step into the server. Connecting to the server
machine [servername] failed. The Microsoft Visual Studio
Remote Debugging Monitor (MSVSMON.EXE) does not appear to be
running on the remote computer. Please see Help for assistance.
So I did what Help said to do and ran the VS 2008 remote debugging wizard on the host server. I have verified that the remote debugger is running as a service on that machine. And it still fails.
Little help? THANKS
Just in case anyone comes here looking for this answer, here it is. No goofy 'Attach to Process', no weird bad instructions
from websites going off on a million stupid tangents. This answer has been FALKENIZED.
When on the same LAN and on the same domain, remote debugging from Visual Studio 2010 works when you do the following steps.
on web service host machine, share the web application folder where the web service lives; give yourself 755 permissions.
oops, give yourself wrxr permissions.
on local development machine, map a network drive to the [web service host machine][web app] folder you just shared.
copy the Visual Studio 2010 remote debugger folder (containing msvsmon.exe + support files) to web service host machine.
Make sure you get the correct platform for your host server, e.g. x86, x64, etc. Remote debugger is found here:
C:\Program Files\Visual Studio 2010\Common7\IDE\Remote Debugger[platform]
on web service host machine, drag a shortcut from the newly-copied debugger to the desktop, then start the remote debugger
on local development machine, step thru code. when reaching a call to the web service, you'll be prompted to navigate
to the location of requested web service code file, which will then be available in your mapped path. Do it.
Finally after 1000000 headaches, you may start debugging your web service. CONGRATULATIONS

SQL Server 08 Express Installed: But how to make a local database?

I try to connect to 127.0.0.1 with Windows Authentication using Management Studio Express 2008 but it never connects says it can't find the server or something. I ran the SQL Server Express 2008 Installer and it said that it was already installed but I can't find any wizard or shortcut to start up anything that will allow me to actually start setting up a local database, what gives?
(Windows 7 x64)
Services were off, turned them on, still not connecting to (local) because of an error: Error 40 could not open a connection to sql server error: 2
NOTE: Turned of windows firewall, same error! everything is local... services running, firewall down, tcp/ip enabled in config... hmm...
Typically, SQL Server Express will install into a "named instance" called SQLExpress.
Try connecting to:
(local)\SQLExpress
.\SQLExpress
(local) as well as just a dot "." stand for the local machine, and \SQLExpress is the default named instance name for SQL Server Express installations.
Have a look at the SQL Server Surface Area Configuration tool that should have been installed with Studio Express. If you use that you should be able to find the settings for Remote Connections. It may be that you have TCP/IP connections turned off (I can't remember what the default is) and only named pipes are available. If that's the case you can either turn on TCP/IP or try connecting using your machine name in Management Studio.
ensure you have your firewalls allowing access then connect to (local) including parenthesis

Resources