Peter
Peter

Reputation: 3008

Unable to deploy Razor Web Site to IIS 6

I've been tearing my hairs out over this one. Found many similar references on StackOverflow and the internet, but nothing seems to help me.

I just keep on getting "Directory Listing Denied" when opening the website, and "This type of page is not served" when requesting a specific .cshtml file.

What I do is the following:

It seems to me that all the required DLLs are included in the Bin folder (included by the "Add Deployable Assemblies" option):

The .NET versions reported on the "This type of page is not served" error page are: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272.

What am I overlooking?

Upvotes: 0

Views: 1778

Answers (2)

Peter
Peter

Reputation: 3008

I've found the answer! It's incredible how long I've had to search for this...

The problem was that the "root" website (my webapp is in a folder underneath the main web folder) had a Web.config file which contained the following:

<add key="webpages:Enabled" value="false" />

This meant that .cshtml webpages were disabled for any website created underneath the main one...

Upvotes: 1

user1845490
user1845490

Reputation:

Have you set the permissions for the website? I think you right click on it and click "Edit Permissions" Also for the error "This type of page is not served" In IIS in default documents add default.cshtml if it does not exist.

Upvotes: 0

Related Questions