?
Solved

How do I configure IIS7 for .cshtml pages

Posted on 2010-09-20
4
Medium Priority
?
6,782 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 28

Expert Comment

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

Author Comment

by:RCM01
ID: 33726344
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 2000 total points
ID: 33726550
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
ID: 33729218
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

771 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