How to host a SignalR application with GoDaddy? - signalr

I've written a small demo application using the ASP.net SignalR library. It works fine when run locally, but when I deploy it to my server hosted by GoDaddy, it gives the following error: GET http://xxxxxxx.com/techdemo/signalr/hubs 404 (Not Found)
I did a Google search and was only able to find this one article: https://blog.adamzolo.com/hosting-signalr-godaddy-full-trust/. Unfortunately, the advice there didn't fix my problem.
I know from the documentation that signalr/hubs is a Javascript file generated by SignalR. Somehow, it doesn't get loaded when the site is hosted by GoDaddy. I need to get this working, so what do I do to make it work?

Related

Implementing Google Calendar API to get a list of events in ASP.NET core

I followed the tutorial here, except that I implemented it in a web app, and everything works fine in localhost, when I call the API to get calendar events for a give date, I get the events list back. However when I deploy to my test site I get a 502 Bad Gateway response, making the same call as in localhost.
Has anybody experienced the same? How to fix it?
If it works on localhost and not on deployment, it just means there are configurations which haven't been met. Check this Web applications (ASP.NET MVC) about setting up web apps using ASP.NET.
In order to run the following code successfully, you must first add a
redirect URI to your project in the Google API Console. Since you will
use FlowMetadata and its default settings, set the redirect URI to
your_site/AuthCallback/IndexAsync.

MVC6/ASP.NET core published to iis 404 on controller endpoints

I have managed to publish an MVC6 website to IIS, but it seems to be only serving the static files in wwwroot. As soon as I make a request to a MVC controller endpoint I get a 404.
What other steps do I need for the backend code to run? I see that in the web.config it is executing the web.cmd file in approot, but this doesn't seem to be running.
Edit Running the web.cmd directly - i.e. using the self-host ability - works fine on the server where the app is deployed.
I had a similar issue to this (404 on every page except for root) and while initially it looked like an IIS configuration issue or a problem with httpPlatformHandler, after running web.cmd manually I was able to find some issues with my connection string.
After fixing these issues I was able to run the site through IIS without any hassles.

connection generated by signalr embedding signalr/hubs/reconnect?transport=longPolling&connectionToken=abc123

I had created chat application using signalr. I faced problem that I was unable to open multiple tabs so to solve that I used cross domain concept.
When I am running the website locally it is not showing any error message and working fine.
But when I am hosting website to server then it is raising following error-
example.com/signalr/hubs/reconnect?transport=longPolling&connectionToken=42x80fo64OLWftVAXxJ1I1bTarAL2eRdRXwlVdx-UtM5KGb6RorETiKlxv8ebJG-_dl8x7NoZw1DJYrW-ECo0gm-lNxIe61V3mxGkoanucScvvnQDQC8vi5UbsGAkNPXD1pH5XA4Tv6FPmVFul3jXY8XR1k3tjdNcDfwihI_atIAJ8msO8BdvV9pbscat0DP0&connectionData=%5B%7B%22name%22%3A%22g2bmshub%22%7D%5D&groupsToken=3pGUI3di_lU7WAhlavII7A9cNpHs5M45qjkX40LnbYETPNicSzr3p3RdNKMaszYKbj8RLxIxGj9KP_gNk0Y3Y61-20hPDt5nTCWIKYsOR4raJQg1szNqUFkgpYwVDatDwE162GS5jj93IGIRjiS8yQ2&messageId=G%2C4%7CO%2C0%7CP%2C1%7CQ%2C0%7CK%2C0&userID=75&tid=7&callback=jQuery1800015164601150900126_1412139385725&_=1412139396182
I have defined the url in webconfig as-
and sets the hub url for connection in designer file as
$.connection.hub.url = "<%= HubURL%>";
Locally it is working fine and taking the same url as in web config file but when hosted, it embeds "reconnect?transport=longPolling&connectionToken=abc112..." to the connection and raising the above error.
Can anyone suggest me how to rectify the above error?
Thanks

ASP.NET WEB API 2 Works Locally But Not On Production Web Server

I've developed a new WEB API 2 that works great locally, however when I upload the same code to my production server (Arvixe in this case) all I get is a 404 when I call it. I've spent HOURS searching the web, reading forums, etc.. and have been able to find no resolution, so I'm asking here as my last effort.
I'm currently only testing with the default project that gets created when you do New Project > ASP.NET Web API 2 Empty Project in Visual Studio. This creates an empty project with a single ValuesController. You should be able the JSON response by called /api/values, but this doesn't even work.
I'm using Fiddler to test the API locally and on the web server.
http://localhost:1993/api/values <--- works great
but
http://api.mydomain.com/api/values <--- returns 404
Note: I created a subdomain "api" in this case, but everything for the code for the API is unchanged from when it was created.
Why in the world does this work locally but not on the production web server?
That the server returns 404 (Not Found) may indicate a lot of things. However you can check using the following step:
Add a simple text document like readme.txt to your a folder sub-domain http://api.mydomain.com, and try to get access to that. If you can't access to that file, it means that the subdomain is not configured properly.
Publish the webservice using the "Publish" functionality, so that all DLLs will be copied.
After that,try to reach the Web ApI again.
Hope that help.
"Note: I created a subdomain 'api' in this case, but everything for the code for the API is unchanged from when it was created."
Above comment of your's is suspicious, you should publish your WEB API application in the root directory. Like if http://example.com is pointing to "MyExample" folder, then application should be published on "MyExample" folder.
After that you will be able access your api with http://example.com/api/{controller}/{action}
Just a simple suggestion which I'm sure you have already considered, but have you opened the http port 80 on the server's firewall?
Also stick a plain old html file in the root of your project and see if the server serves it up.
in your case, since you create a subdomain of 'api', you should try
http://api.mydomain.com/api/api/values
note that if you're using database for the function, you should change the connectionString in your web config
Please verify the .net framework on you hosted domain that may be old one.
Web api 2 is supposed on 4.5 framework.
One reason for web api 2 method working OK on local machine but not on production server is that the method you are calling is working on local machine but not on remote server. In such a case you will receive message 404 or 500, and you would be lost why this routing is failing.
Why a method would fail on remote server, well there may be many reasons. For me, I was querying database in my method and my connectionString was not set for remote server.
One way of resolving it would be to put some very simple code in that particular method and test that routing is working. Then check your original code for errors reasons.

vs2010 express asp.net c#: facebook beginner's application

I followed all the instructions in the following links yet I am getting the following error
Errors while loading page from application
The URL http://zsswfacebooklocal.com:1940/Default.aspx/ did not respond.
Has any one successfully got a simple asp.net application tested on facebook from their localhost on local dev machine. I did update my host file to have local ip 127.0.0.0 point to a temp domain name like zsswfacebooklocal.com
I used the following tutorials but no luck so far. Please help. For FB asp.net application: http://fbtutorial.qsh.eu/section1/step1.aspx
For local host: http://www.stevetrefethen.com/wiki/Facebook%20application%20development%20in%20ASP.NET.ashx
The HOSTS workaround will only work if your app's render method set to IFrame, so double-check that.
On the other hand, if you require your render method to be FBML, then see my response in your other (similar) question:
vs2010 express asp.net c#: facebook asp.net application
If your app's render method is FBML, Facebook tries to load your website the same way anyone over the internet would, so you'd need to set your local website to be accessible to the internet.

Resources