I know there are lots of questions about 404 error of /signalr/hubs folder and i read all of them but none of it is relevant with my problem.
Because normally my code is working on local machine and test server; but same code is not working on production server. This will make me crazy, i tried to recycle app pool, restart IIS or w3svc service but didn't help.
My web site is a secure web site and i think this may cause problem but i couldn't find any thing about running SignalR with SSL.
My project is ASP.Net Web Forms (Web site) and running on IIS 7 on Windows Server Version 6.0 (Build 6002, SP2). App pool is configured to run with .Net Framework version 4.0.30319
P.S: I had another https site which runs signalr without any problems. So i am very confused.
Edit: I had created another web site at same server and copied working codes from working server and tried; result was same. There is something (maybe configuration) about server or IIS.
Solution:
This solution solved my problem too. Actually i had tried this but i got 500 Internal Server Error and gave up. Whatever this is this solution, so i want to change my question what is purpose of this code? Why my site works at another server without this modification?
Ensure that where you're hosting your site is where your signalr/hubs is pointing to. A common issue is that people will host their site like so:
www.abcd.com/mysite/index.html
Now in this example SignalR is hosted at www.abcd.com/mysite/signalr however a lot of people will put /signalr/hubs in their index.html which is wrong. It should be ~/signalr/hubs because the hubs file isn't hosted at www.abcd.com/signalr/hubs it's at www.abcd.com/mysite/signalr/hubs.
Hope this helps!
Use <script src="<%: ResolveUrl("~/signalr/hubs") %>"></script>and that will resolve the problem
Related
I have deployed my newly created web app developed in Asp.net core 2.1 on a windows based shared plesk hosting.
When i tried to browse the site, it give me this error
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.
I have searched it on google but all the help is coming for .net framework not for the .net core framework. Existing solution has suggested me to put this code in web config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
but in .net core 2.1 there is no web.config in the project..
Bottom line issue is still there, don't know what to do.
First of all ensure that the your shared hosting provider support .NET Core hosting as it requires .NETCore Hosting Bundle installed and .NET CLR Version set to No Managed Code
Next publish your ASP.NET Core web app which will generate web.config file and then upload the published files on the server.
You may need to look at hosting's website or get in contact with them to determine whether they support .NET Core, at what runtime version and what needs to be done to have it set up for a website. They may need to do it manually and you may need to downgrade to their version.
The simplest way to handle this with shared hostings is to publish fresh template that works locally, copy it over to hosting (or use Web Deploy to do this directly from Visual Studio) and if it errors, write a ticket that your .NET Core site isn't working and it's up to them to install and set up everything that is necessary.
If they can't get it working, then you won't be able to either. Nothing else you can do, but to change hosting provider.
Literally just stumbled on this question after finding a resolution to the exact same problem.
My scenario is:
I was trying to move hosting providers - website already live, running from old host's webspace.
New host was a shared windows-based web hosting provider, running Plesk.
I was therefore trying to publish my .Net Core 2.0 project to my new host.
...and I kept getting a "403 - Forbidden Access" error.
Here's what I found, which I think might have been part of the problem that the OP faced.
Even though I had published the website to the remote server correctly, the 403 error kept coming until the new host's technical support pointed me to one of their knowledgebase posts, which exactly described my scenario and the issues I had, along with how to overcome them.
Essentially, I didn't have my domain name's DNS settings configured yet (as it was still in use, pointing to my previous hosting provider's webspace) and as such, the DNS are getting 'confused'.
The short-term workaround was to add a temporary entry to my hosts file on my PC, which directed the traffic for my website to the IP address of the NEW web hosting provider. (Once full go-live, these are deleted).
Something like this:
123.123.123.123 mywebsite.com
This allowed me (on my PC) to bypass the DNS settings on my domain name, and to reference the web content on the new web host's webspace, to continue setting-up and configuring the website, prior to full migration
Here's the link to their knowledgebase article, which I'd have never of thought of, until they mentioned it. (And then it made perfect sense!!)
I'm trying to expose my WCF service as part of my main site URL on a server. I have it working on the server (Windows Server 2012 R2 Standard) on IIS 8.5, but can only reach it locally with localhost, or using the machine name, as follows:
http://localhost/TeeSvc/Service1.svc
http://<<machinename>>.mysite.net/TeeSvc/Service1.svc
I have an existing site set up as follows:
http://mystaging.mysite.net
I need to be able to reach the service using:
http://mystaging.mysite.net/TeeSvc/Service1.svc
I saw an article here dealing with this but it relates to an earlier version of IIS and I cannot get the cscript.exe console window to remain open long enough to issue any commands.
How can I go about this?
I was able to get this working by following the same approach in how to construct things in IIS, as outlined here:
Configure URL in IIS
My situation was further complicated by the fact that this was a migration of an older DNN site to version 9.2. There were a lot of unnecessary entries in the DNN web.config file; after I removed the httpHandlers and httpModules sections, I finally got it to work.
I finally got my ASP.NET MVC application hosted on my local Windows/IIS server. I went to the login page but when I try to log in it says,
Error:
An error occurred while processing your request
This is fairly non-descript...
My gut feeling is that when I did the web deploy, I didn't deploy the localdb(?) where the users' credentials are stored. Before I try to re-deploy the entire app, I'd like to see if anyone can offer some guidance. Am I on the right track? Are there other possible causes/solutions I should investigate?
I'm using the default registration/login system that is in the project to start with, and it woks just fine in VS. I did a regular web deploy to my IIS server, and the site works just fine until you go to log in.
Fixed: This issue was caused (as suspected) by the inaccessibility of the LocalDB where all the users' credentials are stored. VS uses this light DB instead of making you install SQL Express or another alternative (much like IIS Express works better for debugging than full IIS). When I push my application to IIS from VS, the database wasn't connecting. I eventually found this other SO question, and the top answer fixed my issue.
How to deploy ASP.NET MVC 4 application using localDB to local IIS on Windows 7?
This will solve the issue, but there is a lot of conflict on the web as to whether or not it is ok to use LocalDB in production, so if you have a lot riding on your project you might want to take a look at that. For my purpose, LocalDB is just fine, so this solved the issue. Thank you to all who responded to my (admittedly) broad question. I'm sure this will be a useful thread for others with the same issue.
Last week I changed the server of my ASP.net Application. Everything is fine except none of the web services seem to work. Nothing happens when the web service is being called from browser. I think there is problem with the IIS configuration or server settings.
I searched a lot in Google for this and did intensive debugging for weeks, yet with no solution. No web services work in my project since we changed server.
Is there any configuration that disables all web services? How can I debug this problem?
At last I got it from here..
Deploying ASMX webservice on iis 7.5
Thanks a lot #Frank.
Thank you Mr Joachim Isaksson For your comments
My RESTful WCF Web service appears to break itself if I leave it alone for a while! I can leave my PC with everything working and when I return and test the service with a simple url request it'll offer me the .svc file for download instead of initiating the request on the server!
This WCF service sits in it's own IIS Application folder under the root. I can get the service going again by opening up the IIS sub-folder in Visual Studio, deleting the web.config file and then adding it in again.
My first thought was that HTTP handler mappings for .svc have been borked so I re-ran ServiceModelReg.exe -i, but that hasn't resolved the issue.
Looking at the Handler Mappings for this IIS Application they appear correct and are inherited from the the web root. It's worth mentioning that this site also has another Application folder running WCF services from a .svc fle and is still functioning fine!
Now that I've checked the obvious am a bit flumoxed about where to look next! Hoping someone has suggestions...
Are you running IIS6 or IIS7? And what .NET-version?
IIS6:
http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
IIS7:
Test this:
"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y
Do you really need .svc-extension in the rest url?
This might solve the problem:
http://west-wind.com/weblog/posts/570695.aspx
Try
Go to programs and features, then turn windows features on or off.
Microsoft.net Framework 3.5.1.
Ensure both options are checked
Windows Communication Foundation HTTP Activation
Windows Communication Foundation Non HTTP Activation
Hope this helps.
Check out this article on getting your extension mapped correctly:
IIS Hosted Service Fails
EDIT: Are you hosting the service in your application? Maybe your app pool getting hung?
Well I did figure this out eventually. Just a weird quirk of IE/IIS. I was testing by putting my REST URI in IE's address bar and expecting to see a page of JSON if everything worked. This is what would happen the first time the service was used. On further attempts IE would offer to download a file called 'FooService.svc' that actually contained my JSON data - I was never being offered to download my server-side svc file.
Ho hum, computers eh. Can't live with 'em, ...
enable 32 bit run for connected app pool in IIS 7
It's resolved my problem.