.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

MVC2 on IIS6

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
Hi all,I'm trying to deploy an MVC2 application on IIS6 with the extensionless urls using wildcard mapping but it has been over 24 hours that I keep running into HTTP 404. Some details:1. I'm hosting on a VPS running Windows Server 2003 SP2 with IIS6 (and Plesk - not sure if this should make a difference)2. The server has .NET framework 1.1, 2, 3.5, 3.5 SP1 and 4 installed, as well as ASP.NET MVC23. While setting up wildcard mapping, I've tried both aspnet_isapi.dll executables from .NET version 4.0.30319 and 2.0.50727 and have made sure that "verify that file exists" is set to false (unchecked)4. Web Service Extensions for framework 1.1, 2 and 4 are all allowedHaving tried all of the above, I still haven't been able to get extensionless urls. I modified my global.asax.vb file to add .aspx at the end of the controller i.e. {controller}.aspx and this works right away, however we do not want .aspx extensions within the url.Is there something that I'm missing? Is there anyone who has been able to successfully deploy MVC/MVC2 on IIS6 without .mvc or .aspx extensions?Any help would be much appreciated.Thank you all!

View Complete Post

More Related Resource Links

MVC2 issue - Stuck. Trying to create a cms with nested partials


I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. 

Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?

Any help would be greatly appreciated as I am confused.

areas mvc2 iis 6.0


hi all,

i have another problem. I am trying to deploy my MVC2 website on iis 6.0. I have added the following to my global.asax:


routes.MapRoute("Default","{controller}.mvc/{action}/{id}", new {controller = "Home", action = "Index", id = UrlParameter.Optional } );

I added the ".mvc" extention because i read that iis 6 needs this. And it works. BUT!! I also use areas, and this is something iis 6 does not understand.

I have the following:
No Areapath: Home.mvc/Index (works fine, no area used)
Areapath: Projects/Overview/Index (does not work!!)

I don't now how to solve this, i hope somebody can help me.




Cannot find ASP.NET tab on IIS6+2003,how to choose .NET framework 4.0?


Hi all,

I just wanna setup a .net framework 4.0 on my VPS for a new site. While I could not find the ASP.NET tab on properties. I did some research find some similar problems but haven't fixed it yet.

Any suggestion would helpful.



Tip #107 Did you know . How to improve debugging performance for MVC2 application in Visual Studio 2

VS2010 Ultimate included IntelliTrace functionality by default.  IntelliTrace captures events (e.g. exceptions), and can affect performance of debugging. The typical performance hit is about 5% in the default mode (collection can be increased to...(read more)

How to switch between HTTP and HTTPS in ASP.NET MVC2


ASP.NET MVC2 has the new RequireHttpsAttribute that you can use to decorate any action to force any non-secure request to come through HTTPS (SSL).  It can be used as simply as this:

        public ActionResult LogOn()

Now any request to the LogOn action that is not over HTTPS will automatically be redirected back to itself over HTTPS.  This is very useful and easy to implement.

Unfortunately though, once the scheme is changed to HTTPS, all following requests will also be under HTTPS, which is not necessarily what you want.  In most cases you do not need all requests to your site to be secure but only certain ones such as the logon page or pages that accept credit card information. 

To handle this you can override the Controller.OnAuthorization method.  From within this method, you can check to see if the RequireHttps attribute is set on the Controller Action by searching the Attributes collection of the ActionDescriptor object. If the RequireHttpsAttribute is not set AND the request is under SSL, then return a redirect result to the HTTP (no

Installing a httpModule on IIS6



I am trying to install a httpModule on an IIS 6 web server. I have the same module working on an IIS 7 test box, but we still have a couple of IIS 6 boxes to support.

The module is:

  • c# .NET 2.0
  • registered in the GAC
  • added to the system level web.config (as we want this for all applications on the box). I followed the instructions from http://msdn.microsoft.com/en-us/library/ms227673.aspx. I tried it with both short name (as in the web page) and the full strong name (like the other entries in the <httpModules> section.

So, I am at a loss as it does not appear to even being called and any suggestions would be appreciated.

Thanks in advance,


ModelBinders obsolete in MVC2?



I have a shopping cart that uses MVC 1 (guide from the book "Pro ASP.NET MVC Framework" by Steve Sanderson). Now that MVC 2 and VS2010 are released, the shopping cart no longer works.

Is there any changes about the ModelBinders.Binders.Add(), is it obsolete in MVC2? The code binder below wasn't hit at all in Application_Start(). Sad


    Sub Application_Start()

ModelBinders.Binders.Add(GetType(ShoppingCart.Model.Cart), New CartModelBinder)
End Sub


Imports System.Web.Mvc

Public Class CartModelBinder
Implements System.Web.Mvc.IModelBinder

Private Const cartSessionKey As String = "_cart"

Public Function BindModel(ByVal controllerContext As ControllerContext, ByVal bindingContext As ModelBindingContext) As Object Implements IModelBinder.BindModel
If (Not (bindingContext.Model) Is Nothing) Then
Throw New InvalidOperationException("Cannot update instances")
End If
Dim cart As ShoppingCart.Model.Cart = CType(controller

Multiple forms on the same page MVC2: how to handle (including validation from model)



It should be simple; although I'm having a hard time to figure out the best way to do it. I've MVC2 pages with multiple forms on the same page having different functionalities.

What's the best way to handle this; including the MVC2 way of validation from the model?


MVC2 Music Store - How to get store controller - store.aspx working {genre names displayed}



<p>Select from <%: Model.NumberOfGenres %> genres:</p><ul> <% foreach (string genreName in Model.Genres) { %>

<li> <%: genreName %> </li>

<% } %>


MOST PEOPLE WILL BE USING VISUAL STUDIO 2008 sp1, to get this to work change the <%:, ONLY WITH SEMI COLONS, TO <%=

Asp.net MVC2 Linq to Sql



I am a little new to this concept so bear with me.

1) I need to query atleast 35 tables using linq to sql(SQL server database) . I am not able to add all the database entities in Linq to sql classes?

2)(View Model issue) When I use List<Reportcollection> and also List<Receipt> to convert the result then its giving an error that "Cannot convert list<anonymous> to list<string>"


Please suggest me both the issues. Thanks in Advance


corrupt html from custom control on win2003/iis6 box


Hello everyone -- first time poster and relative newcomer to the boards.  This bug I'm tackling has me at my wits' end and it's come time to turn to the masses!  If this is posted in the wrong forum and/or has already been addressed, I apologize.  However, I've done thorough searches and haven't come across anything akin to what I'm facing.

I'm working with a website that has a set of custom controls, all descending from a base class.  These controls take DataSets returned from web services and renders custom html via overriding the Render method.  Everything works fine on my local box and my coworker's box (both xp machines running iis 5).  However, on our server (windows server 2003, 64-bit, iis 6), the html rendered by the browser appears corrupt, with garbage replacing individual characters, as follows:


ASP.NET MVC2 -- Linq to sql -- Crystal Reports



I need to generate almost 73 reports using Crystal reports using SQL SERVER. I might get more data from XML so opted ASP.NET MVC2.

I have 2 questions:

1) I have a lot of tables to generate Data Context around 35 ( I was thinking to write more stored procedures). Any help with that?

2) Is it possible to create one Report viewer/Crystal report  to display these reports ( I just need to  Read data by querying on input No CRUD operations)

If somebody can explain me the best process to use. Thanks in Advance. 

Why does MVC2 reset my Context.User but MVC1 doesn't?

The question comes from a previous thread, but I would like to ask a more specific question from anyone in the know.Why does MVC2 reset my Context.User, discarding changes made in Application_AuthenticateRequest but MVC1 does not?Repro is pretty simple:Start an MVC1 and MVC2 new project. In both of them add the following code in global.asax: protected void Application_AuthenticateRequest(Object sender, EventArgs e) { if (Context.Request.IsAuthenticated) { FormsIdentity ident = (FormsIdentity)Context.User.Identity; Context.User = new System.Security.Principal.GenericPrincipal(ident, new[] { "FooAdmin" }); bool result = User.IsInRole("FooAdmin"); } } // break hereNow in both HomeController.cs files change the Index Action to: public ActionResult Index() { bool result = User.IsInRole("FooAdmin"); ViewData["Message"] = ""; // break here return View(); }Deploy to IIS, attach debugger on the "// break here" lines and then login to each site in turn.You should find that under MVC1 the result variable at both breakpoints is true, but in MVC2 it is false in the Index action.Anybody have any idea why? Is this a bug or by design? Any way around it?

error in MVC2 on empty string form fields which are required: "This property cannot be set to a null

In model I have:[DisplayName("ISBN")] [Required(ErrorMessage = "ISBN is required.")] [StringLength(50, ErrorMessage = "ISBN book must have max {1} chars.")] [DisplayFormat(ConvertEmptyStringToNull = false)] public string isbn { get; set; }But when I submit form with empty field ISBN I have an error - ConstraintException: This property cannot be set to a null value.I have find that other people have the same problem and they say that debbugger in VS2010 works wrong - yes ?http://p2p.wrox.com/book-professional-asp-net-mvc-2/79788-constraintexception-unhandled-user-code.html#post259245http://efreedom.com/Question/1-3129080/Server-Side-Validation-REQUIRED-String-Property-MVC2-Entity-Framework-Workhttp://mvcmusicstore.codeplex.com/workitem/6604

css and mvc2

Hi,Is it just me or is mvc 2 just not that friendly when it comes to working with css? Say i want to make one particular page with a different color background from the rest. Well, i can't just embed within that page the css rule as there is no <head> in the aspx page. The only option is to make a new .master page just for that page, and a new css page attachment to that master page. So i've had to create 2 files just so i have the freedom of working on a particular aspx page with css.Is this right or is there simpler way to add css to aspx pages?

Visual Studio 2010, MVC2.0, IIS7, .NET4 deployment problem

I have a problem where I can get an MVC2.0 application using .NET3.5 running in IIS, but when I upgrade it to .NET4.0, the browser just reports error 500 Internal Server Error. The problem is easy to replicate as follows.  Firstly, to show it works with .NET3.5: Create a new MVC2.0 application in Visual Studio 2010, using the inbuilt starter template. Run the application using the development server, and the Home & About pages display fine. Publish the application to a directory. Copy the directory to a subdirectory under inetpub/wwwroot on my Vista computer, running IIS7 Create a new application in IIS Manager & select the DefaultAppPool (integrated pipeline) Browse the application and Home & About pages are displayed. Then the problem I have is after upgrading to .NET4.0: Change to .NET4.0 for the project in Visual Studio Build & this runs fine with the development server. Publish the application & set up IIS as before, except choosing the application pool ASP.NET v4.0 (integrated pipeline) Browse the application, and I get the 500 Internal Server Error I'm guessing there is some extra configuration required - can anyone help? I've deliberately used the default MVC installation to eliminate any variables caused by my programming .. Thanks in advance, Steve

Migrating MVC1 application to MVC2

I am having a Asp.net MVC1 based application which needs to be migrated to Asp.net MVC2. I opened this application in vs2010 and it automatically migrated it to MVC2. However one of its code line is creating problem during page exceution. I have following line in Application_start funtion of Global.asax ModelBinders.Binders.DefaultBinder = new Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder(); This is because Microsoft.Web.MVC.DataAnnotations dll is missing in MVC2. I tried to skip this error by commenting this code but that is also giving error. Can somebody please guide me about its replacement code. Thanks in advance Cheers TicArch
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend