Windows service does not work outside office environment - c#

I have developed my own Windows service on my work laptop. It is installed on tcp on local host on the port 555. The service can be easily started and stopped from the office whether I am connected via LAN or Wifi.
Once the service is installed it will look for some jobs it has to do from an Sqlite database which, as you know, works without a connection and does not require a server.
As soon as I take my laptop home the service becomes unavailable. My program generates a SocketException that says
No such host is known
And the service is unable to start.
So I spent half a working day to check my program for errors. Eventually I came back to the office to see the service is back to work without me having changed a thing. To make sure, I took my laptop to a coffee shop nearby and tested using their Wifi. It did not work there either.
I checked my IP on What Is My IP? for any proxies but there are no proxies detected. But the mother company of my office that is giving us the internet resides in another city and What Is My IP also thinks that I am in that city. So I am currently only able to develop and test my service in the office environment. But that of course is a very bad thing since this Windows service should soon be installed on our customer servers. Any clues?

Related

Working with System when there is No internet

I have an application that works as a Point of sale(POS). It's designed on angular with mssql as the backend. Now its hosted on a server. It is currently working in a restaurant but sometimes since the restaurant has a makeshift internet, It keeps disconnecting etc. Is there a way to make the thing work without internet. At least just to take the order and then when the internet is one it connects to the cloud and updates the DB.
Depending about what you must do. Yes you can install the server in a local machine and you start your angular in your local machine, but you need to use a local machine server if you use POS to take orders. You can create a private connection with a server and connect all subject to this connect. The customers for pay must be connect to internert.

Error IIS and Android

I'm Brazilian, and I apologize for my English, which is very bad
I've been facing a problem for some time, and I'm tired of looking for a solution in Portuguese.
I created a WCF service to be consumed by Android, hosted on a computer that I have at home with Windows server and iis installed, configured all the correct port releases for the application to work on the phone, but it has the following error in the execution: System.Reflection .TargetInvocationException
So I decided to host the WCF service on an external server, I used the number service. I just uploaded the files to it and changed the address references in the application to communicate with the WCF, and then it worked, so I guess some configuration that has to be done in IIS or in Windows itself, I'm waiting for some help. Thank you

What blocks a .NET executable from creating a listening TCP port on localhost?

I have an application that creates a HTTP server on a random port (50000-59000) on "localhost". It tries to connect to this port afterwards to determine if everything was setup correctly and is ready to use.
This seems to work on most machines very well. Its written in C#.NET 4.0 for Windows XP and higher.
Now I have the problem that on one server at one customer the creation of the server seems to work but it can't connect to it. Sadly we didn't any information as the exception details were not outputted from this software as it has happened.
It works if the file is on local disk. If they start it from a specific Windows network share it stops working. I think that the have a special setting which causes this issue. But I don't know that could be reason.
My Question:
Do you know settings, an system administrator could make, that prevents a software, running as normal user, to connect to a listening port, that the program has opened just a moment ago? May be group policy settings in the active directory?
I've written a test program to try this again at our customer.

Difficulty getting Visual Studio 2010 to attach to remote processes

It's been years since I've had such a hard time getting something to work. I'm at home, on subnet 192.168.50.nnn. I VPN'd in to XYZ company office machines that are on subnet 192.168.40.nnn, domain XYZ. I can ping the remote machines, I can net map their drives and copy files back and forth, but for the life of me I cannot remotely debug a C# program running on a machine called R (ipaddr 192.168.40.100, Windows Server 2003, IIS-6) from Visual Studio 2010 on my laptop (ipaddr 192.168.50.10, Windows 7, user XYZ\username, machine name L). I've read every MSDN article I can find, I've checked firewall settings, I unblocked port 135, I have the same user name and password on the two machines, I've tried running msvsmon.exe on R as a service and as an application (advertising itself as username#R), msvsmon has sufficient privileges, but I just cannot attach to any process on R. I can't even get a list of processes on R to show up. If I could pay someone to fix the problem I would, but I wouldn't pay a dime until I saw it working.
[Note: The IP addresses above are illustrative only, not the real values.]
I had a similar problem and my setup looked like this:
Client: Windows 7 x64 on a private subnet 192.168.1.x. Running Visual Studio 2010
Server: Windows 2008 R2 Standard SP1 with a public IP-address
Both client and server where stand alone. I.e. no domains, just workgroups.
VPN connection from client to the server and when I connected the client got the ip 192.168.0.131 and the server 192.168.0.130.
Turned off all firewalls etc. for the VPN connection, created identical users on the client and the server and identical password.
Ping, network shares, etc. working with no problems over the VPN connection. But I got the same error message from Visual Studio: "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."
The solution for me was to change the workgroup name on the client to the same one as the server.
After that, everything worked perfectly.
You need to be authenticate on the same domain (or at least there be a trust relationship between the two) as the remote machine. Is the local machine attached to the domain on the other side of the VPN? If not, you cannot debug managed code using remote debugging.

Computer A can reach network web service, while computer B can't. Any ideas?

You'll have to pardon me as I wasn't sure where to place this. This overlaps in the areas of C# Web Services and Network/Security management I suppose.
I have a server that runs various web applications. One of them is a web service. The account everything runs under is a local account on the machine. It is not a domain account. I don't know why this was done how it was, but it's one of those things that's just the way is because it's the way it was done.
Super, huh?
Okay so my domain account name is given full permissions on the web serivce. Now, while the account the web service runs under is not a domain account, the machine is on our domain and in our network. So, from my computer, I can fire up a browser and type in the url to the web service in this fashion:
http://serverhere:porthere/servicename
Now the fun part. From a different machine on the same network and logged in my domain account, I cannot load the web service.
Here is the really, really nutty part. From both machines A and B, I cannot ping the server hosting the web service. Might be because pinging is turned off.
So the million dollar question is, does any one have any idea's at all as to why computer B cannot access the web service while computer A (my machine) can?
The server hosting the web service is running windows 2000. My machine is running windows xp. The machine that cannot load the web service is running Windows 2003 SP 2.
Check to make sure the subnet masks for both machines are the same; if one subnet is more restrictive than the other, it'll basically ignore messages from that machine.
There are too many options for this. And I would not bet on account permission issue. You should check the communication with network sniffer, like wireshark or network monitor. Check proxy settings. and post more information about the error you receive.
Silly suggestion, but did you check the firewall settings on the 2003 machine?

Categories