Solved

How do I configure IIS7 for .cshtml pages

Posted on 2010-09-20
4
6,631 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 500 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

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…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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