0

VS2013 Update3, .Net 4.5, MVC, IIS 7

I created a new mvc project. Tested from VS and it works. From IIs, I created a folder in wwwroot, and made it an application. Add app pool with .net 4.0. Enabled windows authentication and disabled Anonymous authentication. Set service account in app pool and webapp. From VS I deploy to IIS with default settings (which is NOT precompile) (using File System) Site works fine on IIS. But… If deploy with the precompile setting clicked on. Web site fails with 403 error. Tried various combinations and get never get the precompiled to work. Always works when non-precompiled.

ASP.NET 4 was is registered in IIS. Tried modules runAllManagedModulesForAllRequests="true" with no success.

I'm out of ideas and looking for help

Server Error in Application "xxx/MVCHELLOWORLD"

Internet Information Services 7.5



Error Summary 
HTTP Error 403.14 - Forbidden

The Web server is configured to not list the contents of this directory.


Detailed Error Information 


Module
DirectoryListingModule 

Notification
ExecuteRequestHandler 

Handler
StaticFile 

Error Code
0x00000000 



Requested URL
http://xxx/MvcHelloWorld/ 

Physical Path
C:\inetpub\wwwroot\MvcHelloWorld\ 

Logon Method
Negotiate 



Most likely causes: •A default document is not configured for the requested URL, and directory browsing is not enabled on the server.


Things you can try: •If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
• Enable directory browsing using IIS Manager. 1.Open IIS Manager.
2.In the Features view, double-click Directory Browsing.
3.On the Directory Browsing page, in the Actions pane, click Enable.

•Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.


Links and More InformationThis error occurs when a document is not specified in the URL, no default document is specified for the Web site or application, and directory listing is not enabled for the Web site or application. This setting may be disabled on purpose to secure the contents of the server. 
View more information »
RitchieD
  • 1,831
  • 22
  • 21

1 Answers1

1

I just had the same issue and have been trying to resolve it for the last couple of days.

I have a Windows 8 pc running IIS 8 Express.

I copied an MVC site that was compiled and published from another pc, ran it, and got the same 403.14 forbidden as above. I then tried publishing the site uncompiled and running it and the site loaded just fine.

I then decided to load Visual Web Express on the Windows 8 pc and created a dummy MVC site and ran it compiled and uncompiled and it worked just fine. This showed me that IIS 8 Express was configured and working properly and there must be some issue in the way the site was compiling.

I tried different precompile methods during the publish including do not merge, merge all and merge each folder but none of those many any difference.

In the end I solved this by changing the Copy Local property to true for every Assembly referenced within the project. Even all the default ones that should be referenced from the GAC.

Not sure if I needed to copy every assembly to the bin folder or not but given the large number of assemblies referenced within my project this seemed easier then trying them 1 by 1.

EDIT: Made some changes and republished the site and now I'm back to the 403.14 forbidden again :(

I'm really pulling my hair out on this one as to why it isn't working.

JustinC
  • 21
  • 3