简体   繁体   中英

iis directory browsing cause signalr 404 Not Found error or not?

I write an asp.net 4.0 web application, signalr2 , and after many trials and getting the 404 Error I decided to change my scenario of signalR to a very simple sample in order to fix the issues on my server.

I was getting Error 404 for http://subdomain.domain.com/signalr . However, this sample works smoothly on my local computer.

  1. I have added web config <modules runAllManagedModulesForAllRequests="true"/>
  2. I have changed the signalR script reference with resolveuri and many other types.
  3. and added route.maphub() with cross domain origin in global.asax

I was trying all listing article but am getting Error 404. Also see Github signalr FAQ and StackOverflow Article .

Finally, I want to know if maybe the IIS directory browsing with disable status can cause this issue?

MapHubs is a version 1 method- you need to use MapSignalR instead if you're using SignalR 2. See the upgrade tutorial for details:

http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/upgrading-signalr-1x-projects-to-20

Are you able to access your hubs folder? In Chrome (not IE, since it will just try to run the JS), navigate to /signalr/hubs on your server. This should show a JavaScript file.

Also, try adding these to your application's Startup class:

app.UseWelcomePage();

This should add a default page to your root directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM