IIS 10中ASP.NET 4.5.2 MVC应用出现403.14错误求助
Hey there, let's work through this 403.14 error together—since your app runs fine in IIS Express but not local IIS, the issue is almost always about missing MVC-specific configurations in IIS. As a fellow dev who's fumbled through this as a newbie too, here's what to check step by step:
Verify ASP.NET Components are Installed in IIS
Local IIS doesn't always come with all the ASP.NET bits needed for MVC. Open Turn Windows features on or off, navigate toInternet Information Services > World Wide Web Services > Application Development Features, and make sure these are checked:- ASP.NET 4.x (match your project's .NET Framework version)
- URL Rewrite Module (critical for MVC routing to work)
- .NET Extensibility 4.x
Configure the Application Pool Correctly
- Open IIS Manager, find your
webapp3application, and check which application pool it's using. - Right-click the pool > Advanced Settings.
- Set .NET CLR Version to match your project's framework (e.g.,
v4.0.30319for .NET 4.6+). - Set Managed Pipeline Mode to Integrated—classic mode doesn't play nice with MVC's routing system.
- Open IIS Manager, find your
Register ASP.NET with IIS
Sometimes IIS doesn't have ASP.NET properly registered. Open Command Prompt as Administrator and run the appropriate command for your .NET version:# For 32-bit .NET 4.x C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i # For 64-bit .NET 4.x C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -iThis ensures IIS recognizes ASP.NET requests and routes them to your MVC controllers.
Confirm Your MVC Route Configuration
Double-check that your project has a valid default route set up. OpenRouteConfig.cs(usually in theApp_Startfolder) and make sure you have something like this:routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } );Also, confirm that you have a
HomeControllerwith anIndexaction method, and the correspondingIndex.cshtmlview exists inViews/Home/.Check Folder Permissions
IIS needs permission to read your app's files. Right-click yourwebapp3folder > Properties > Security tab. Add the application pool's identity (e.g.,IIS AppPool\YourPoolName) and grant it Read & Execute, List Folder Contents, and Read permissions.
After making these changes, restart IIS (either via IIS Manager or running iisreset in Command Prompt) and try accessing localhost/webapp3 again. This should get your MVC app routing correctly instead of trying to list directory contents!
内容的提问来源于stack exchange,提问作者Programmermatt

