SignalR not functioning on server - asp.net

I have a windows service I made through visual studio in c#.
It uses SignalR to connect to a SQl database and receive notifications.
However, when I deploy the service onto the server itself (Windows Server 2008R2), it doesn't function. This server is the server hosting the SQL server too.
This is a SELF-HOSTED SignalR service. It is not using IIS or anything of the like to run. It is packaged as a simple Windows Service. Therefore, it doesn't have issues with typical MVC, IIS hosted apps (such as /signalr/hubs pathing, web.config etc.)
On my development computer, I use the WAN IP of the sql server to connect to its database. When I run it, it does everything it's supposed to and fires off a notification everytime server changes.
On the server itself, the service installs fine, but doesn't fire off any notifications. I left the IP as the WAN IP for developmental services and was planning to change it to localhost, etc. once it works but it does not.
For now, I left the service running on my development computer, and it's working great. I'd really prefer it to be on the server itself though, since that's the computer that will always be online.
Any hints or ideas on why this works on my development computer but not the server?
Thanks!
[Edit]
I'm using Windows 7 with Visual Studio 2013 as my development setup.
The service is running on localhost:2165 (arbitrary port). I am able to access that address via a web browser on the server itself.

You don't state what your development operating system is, but if you are using WebSockets, then you need to have a minimum of Windows 8 or Windows Server 2012.
From the documentation, the supported platforms are (emphasis mine):
Supported server IIS versions
When SignalR is hosted in IIS, the following versions are supported. Note that if a client operating system is used, such as for development (Windows 8 or Windows 7), full versions of IIS or Cassini should not be used, since there will be a limit of 10 simultaneous connections imposed, which will be reached very quickly since connections are transient, frequently re-established, and are not disposed immediately upon no longer being used. IIS Express should be used on client operating systems.
Also note that for SignalR to use WebSocket, IIS 8 or IIS 8 Express must be used, the server must be using Windows 8, Windows Server 2012, or later, and WebSocket must be enabled in IIS. For information on how to enable WebSocket in IIS, see IIS 8.0 WebSocket Protocol Support.

Related

IIS hosted WCF using net.tcp

A version of this question has been asked many times. I cannot find a solution to my particular problem.
IIS 7.5 is hosting a web app as well as a WCF service using tcp. I have this running fine on several development boxes running Windows 7.
I get the error "Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding..." when I try running this on a Windows Server 2008 R2. --Even when trying to access it locally, from the same box.
I've enabled the proper bindings (net.tcp)
I've enabled the proper windows features (non-http activation, etc.)
the appropriate Windows services are running (net.tcp listener adapter, etc.)
Anyone have any ideas what else might be the problem?

Deploy SignalR on small Intranet without using Windows Server

I have an ASP-based application which provides real-time data from a local server to a small group of local users via mobile and desktop browsers (around 10 at any one time). Most of my installations use IIS running on Windows 7 Pro. Until now I have been using ajax short polling but am now prototyping changing the transport to SignalR.
Unfortunately it seems that using IIS on Windows 7 is not an option with since SignalR keeps a large number of connections open and in this configuration IIS has a concurrent connection limit of 10:
http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/supported-platforms
I am considering attempting to use IIS Express for my deployments. Is this a route worth pursuing? What are the pitfalls? Do I have any other options (other than to install Windows Server).
Thanks all
You can use self host signalR on a windows service see here for a sample
I use it on a Win7 machine

ASP.NET site connects to remote via SSL from Visual Studio but not IIS

My question is: why does a dev site work when the project is run in Visual Studio 2010, but not when served from IIS on the same PC?
I am trying to set up a dev copy of a client's site. On startup, the site makes a connection to a remote database server. The connection uses WCF and a SSL certificate to secure it. When I installed the site on my PC, following instructions, I installed a Cert Chain into the "Trusted Root Certification Authorities" and added registry keys and host entries to resolve connections to the remote service.
When I open the solution in Visual Studio 2010 on my PC and run it in the built-in ASP.NET dev server, it works -- my workstation connects to the remote service via SSL on a custom port (444) and the dev site queries for data successfully from the service. All of this is handled by a DLL provided with the project, and is outside my scope of work. I was briefed up front that the connection was very finicky about the SSL cert, system clock time agreement between the two machines, etc. and it took me a few tries to get it to work.
However, when I run the site in my local IIS (Windows 7, IIS 7.5) the site cannot connect to the remote service; the service won't accept the SSL connection. The startup code throws an exception when this happens, preventing the site from loading further.
Everything else seems to work fine: the only wrinkle is that VS requires a 32-bit version of the secure connection DLL while IIS on Windows 7 requires a 64-bit version. Both were provided to me and I swap them as required.
Per the comment, the answer is: check that the Cert Chain (to trust the SSL certificate used by the WCF connection) is installed to Local Machine (so that IIS sees it), not just to Current User (account used by Visual Studio).

Cannot connect ASP.NET development server (VS2010) via IP address

Visual Studio 2010 / ASP.NET project / ASP.NET Development server
I can run and debug my VS2010 ASP.NET project from my development computer (where VS2010 runs). URL: http://localhost:port/MyApp.htm works fine.
Since I want to test the application from an IPad as well, I need to call the application with its IP address such as http://192.168.0.132:port/MyApp.htm
To my surprise this does not work, neither from the IPad, nor from the dev. computer itself. It is not a matter of connectivity, the address is correct / ping is possible.
(Note that I have no IIS installed on this machine, actually the ASP.NET application is plain HTML+JS, I use VS2010 just for debugging.)
Any workaround for this?
The Visual Studio Development Server will only serve pages to the local machine:
From Web Servers in Visual Web Developer:
If you cannot or do not want to use IIS as your Web server, you can
still test your ASP.NET pages by using the ASP.NET Development Server.
The ASP.NET Development Server, which is included with Visual Web
Developer, is a Web server that runs locally on Windows operating
systems, including Windows XP Home Edition. It is specifically built
to serve, or run, ASP.NET Web pages under the local host scenario
(browsing from the same computer as the Web server). In other words,
the ASP.NET Development Server will serve pages to browser requests on
the local computer. It will not serve pages to another computer.
Additionally, it will not serve files that are outside of the
application scope. The ASP.NET Development Server provides an
efficient way to test pages locally before you publish the pages to a
production server running IIS.
The ASP.NET Development Server only
accepts authenticated requests on the local computer. This requires
that the server can support NTLM or Basic authentication.
If you wish to test pages remotely you will need to use IIS or IIS Express.
I ran into this same problem and found a great solution. You can use SPI Port Forwarder (or a similar tool) to forward outside requests to the VS development web server. It works great and you can turn it on and off as needed.
Check out the info here:
Accessing the Visual Studio ASP.NET Development Server from iPhone & iPad
http://opensource.oxyva.nl/simple-development-proxy seems to work around Visual Studio Express 2012 for Web not allowing connections from other devices like iPhone, iPad etc. which result in "HTTP Error 400: Bad Request - Invalid Hostname"
There seems to be another solution as described in: visual web developer Web service on debug HTTP/1.1 400 Bad Request
You need to set up a WebSite in IIS, and deploy solution to virtual directory for the application to be accessible through an IP address outside of localhost(127.0.0.1)

How to access ASP.NET App Over a Network Using IP Address

My asp.net web app is hosted on this URL on my local machine:
http://localhost:45433/
I want to access the same application from a different computer on the network. I tried replacing the localhost with my IP but it did not work.
any ideas!
UPDATE 1:
Now, I am getting this error:
Login failed for user ''. The user is not associated with a trusted SQL Server connection.
If your application is hosted using Visual Studio's built in web development server then this server does not allow remote connections. It is for testing purposes only and accepts connections only from localhost. In order to access your application from remote clients you might need to deploy it to IIS.
First, add the application as a virtual in IIS, and as long as you can access the machine on the network, you can do:
http://<machine name>/<virtual>
I do that at work, where I can access my co-worker's web site.
HTH.
That looks a lot like a url used by the development web server in visual studio. That web server only responds to requests from the localhost. It won't work for other requests from other machines on your network.
You need to install IIS on your machine (must be a Pro version of Windows) and deploy to that IIS install to share your app on the network.
I don't think the built-in version of Cassini (VS debug server) allows remote connections.
However, the UltiDev version, built off of the same code base with a few enhancements, does, and is a much lighter-weight install than IIS (especially if you can't find your OS install DVD). It also integrates nicely with Visual Studio for debugging purposes.

Resources