Set Up IIS For An MVC App: When All Else Fails, Check View Config

by Jon Davis 29. April 2009 17:22

I got stumped today when trying to set up a CruiseControl.NET+RoboCopy powered development server deployment for an ASP.NET MVC web app. I set up MVC Framework (gets MVC into the GAC), did the wildcarding in the IIS app config, and everything worked fine, except for strongly typed views. I was confounded. The Event Viewer showed:

Exception information:
    Exception type: HttpParseException
    Exception message: Could not load type 'MyMvcApp.ViewPage<MyModel>'.

This turned out to be caused by a simple mistake. After cc.net compiles the app, RoboCopy copies all the .aspx files over to the web app, and ignores the .cs files, the .config files, etc., so that the .config files don’t get overwritten. I had manually deployed the main web.config file for the app, but I forgot that the Views directory also has a web.config.

Why there is a web.config in the Views directory, I don’t know yet. But the extra .config file in the Views directory is absolutely mandatory to get an MVC app working on IIS, or at least on IIS 6 anyway (haven’t tried 7).

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading




 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  August 2020  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

View posts in large calendar

RecentPosts