简体   繁体   中英

Installing .net web api on iis7 causes 404 not found

I installed my WebApi like it's described one this page:

http://www.c-sharpcorner.com/UploadFile/2b481f/how-to-host-Asp-Net-web-api-on-iis-server/

After that i opened a Resource of the api in the browser, which causes this error:

Http-Error 404.0 - Not Found

Notification MapRequestHandler

Handler StaticFile

Is there possibly something I configured wrong, I wondered, why the StaticFile-Handler is used when I'm browsing a Route to an api Method

I usually fix the problem like this running a command: aspnet_regiis -i

See details here: https://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

After some more research, adding this line

<modules runAllManagedModulesForAllRequests="true"/> 

to the web.config under system.webServer, solved the Problem

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