Deploying IIS 404.0 not found and webapi404.0 using WebApi
Background
Local Environment: Win7, Visual Studio 2013, IIS 7.5
WebForm project, add an http interface for others to call.
My approach is to add a Controller and add a route in Application_Start.
Then pass the local test.
Release
Publishing machine environment: Window Server 2008 R2, IIS 7.0
After the release, the access interface throws the 404.0 not found page.
The general troubleshooting method for the online search solution is as follows:
1. confirm that. net framework 4.5 is installed.
2. Modify the web. config Configuration
Configure the modules and handlers nodes under the system. webServer Node
<system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer>
<Handlers>
<Remove name = "ExtensionlessUrlHandler-Integrated-4.0"/>
<Remove name = "OPTIONSVerbHandler"/>
<Remove name = "TRACEVerbHandler"/>
<Add name = "ExtensionlessUrlHandler-Integrated-4.0" path = "*." verb = "*" type = "System. Web. Handlers. TransferRequestHandler" preCondition = "integratedMode, runtimeVersionv4.0"/>
</Handlers>
However, none of the above methods can solve my problem.
Then I realized that the 4.0 Classic Mode of my application pool configuration solved the problem through the following methods ~
3. Add a wildcard script ing
Or modify the configuration.
<Handlers>
......
<Add name = "all" path = "*" verb = "*" modules = "IsapiModule" scriptProcessor = "C: \ Windows \ Microsoft. NET \ Framework64 \ v4.0.30319 \ aspnet_isapi.dll "resourceType =" Unspecified "requireAccess =" None "preCondition =" classicMode, runtimeVersionv4.0, bitness64 "/>
</Handlers>