Deploying IIS 404.0 not found and webapi404.0 using WebApi

Source: Internet
Author: User

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>

 




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.