Solved

How do I configure IIS7 for .cshtml pages

Posted on 2010-09-20
4
6,374 Views
Last Modified: 2012-05-10
Hello,

We're looking at using WebMatrix to develop a new website using the Razor syntax. I'm trying to get all the pieces in place and familiarize myself with everything before we start the project. I've successfully written an app on a developer pc, and set up our IIS so that we can use WebDeploy to push the code from the deleveloper pc to the Server. When I try to run the app, which works perfectly on the developer station, the IIS server returns a 404.3 error indicating that the default.cshtml cannot be served.

I have verified that the .dll for the project were correctly deployed to inetpub/wwwroot/bin directory on the server.
I have also added to the web.config, based on another post, a system.web section.
I have verified that .Net Framework 4 Client Profile, Extended are installed on the Server

Thanks
0
Comment
Question by:RCM01
  • 2
4 Comments
 
LVL 28

Expert Comment

by:strickdd
Comment Utility
Verify your handler mappings include the proper mapping for .cshtml. (Select the website and click "Handler Mappings")
0
 
LVL 2

Author Comment

by:RCM01
Comment Utility
I did check and there isn't a handler listed. Any idea of a handler to add. I can't find one listed.
0
 
LVL 14

Accepted Solution

by:
wolfman007 earned 500 total points
Comment Utility
If you only have the .Net Framework 4 Client Profile then you will not have ASP.NET so you will be missing everything required to run ASP.NET 4.0

Which is why your handler mapping is missing.

The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications.

Features Not Included in the .NET Framework Client Profile
--------------------------------------------------------------------------------

The .NET Framework 4 Client Profile does not include the following features. You must install the .NET Framework 4 to use these features in your application:

ASP.NET

Advanced Windows Communication Foundation (WCF) functionality

.NET Framework Data Provider for Oracle

MSBuild for compiling

From

.NET Framework Client Profile
http://msdn.microsoft.com/en-us/library/cc656912.aspx

I would recommend uninstalling the .NET Framework Client Profile, and then installing the full version of the .NET Framework Version 4.0 and then trying your application again.
0
 
LVL 2

Author Comment

by:RCM01
Comment Utility
Thanks wolfman007
That was it. I can't believe I missed that. We've been messing with the server so much, I didn't even think to check that.
One other thing that I had to do after installing .Net4 was to make sure that the website was using the application pool for .Net4. Mine wasn't and I received a 404.17 error when i tried to access it after installing the .Net4 framework.
Also, to save some headaches for anyone else who is trying WebMatrix, our IIS is behind a firewall and after several attempts at using FTPS to publish to it, I ended up using WebDeploy which requires that the WebManagementService be installed and running on the IIS server.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now