views:

439

answers:

1

I have a site built with MVC Preview 2 and have not got around to upgrading to latest release, mainly because of the number of changes required and I have not had time. Anyway, last night my host installed .NET 3.5 sp1 and it killed my site. It is an identified problem (thats what you get for using pre betas) on this site http://haacked.com/archive/2008/05/12/sp1-beta-and-its-effect-on-mvc.aspx and it says to go to this site for a work around http://www.asp.net/downloads/3.5-SP1/Readme/default.aspx.

Unfortunately the work around seems to have been taken down. Can anyone shed some light of what it did say and what the work arounds are.

+1  A: 

Maybe this instructions are useful, they are to migrate the site on mvc preview 2 to mvc preview 3. As preview 3 sites are not affected by the beta sp1, I hope it helps:

Upgrading an Existing Preview2 Application to Preview 3 The information in this section describes the changes you must make to modify an ASP.NET MVC application that was created with the Preview 2 release so that it works with the Preview 3 release.

Code Changes Update the references to the following assemblies to point to the new Preview 3 versions of the assemblies:

System.Web.Abstractions 
System.Web.Routing 
System.Web.Mvc

By default, these assemblies are located in the following folder:

%ProgramFiles%\Microsoft ASP.NET\ASP.NET MVC Preview 3

For all existing action methods, change the return type from void to ActionResult. Anywhere you call RenderView, change it to a call to return View. You can search for RenderView( and replace it with return View(.

Anywhere you call RedirectToAction, prepend the call with the return keyword. Search for RedirectToAction( and replace it with return RedirectToAction(.

If you use a strongly typed page, replace <%= ViewData.PropertyName %> with <%= ViewData.Model.PropertyName %>. Rather than replacing the ViewData object with your strongly typed object, the MVC framework now sets the Model property to the instance that you provide.

In the Global.asax file, remove the route definition for Default.aspx. In the default Preview 2 template, the route looked like the following example:

routes.Add(new Route("Default.aspx", new MvcRouteHandler())
{

  Defaults = new RouteValueDictionary(new { controller = "Home", action = "Index", id = "" }),

});

In the Global.asax file, find the following default MVC route:

routes.Add(new Route("{controller}/{action}/{id}", new MvcRouteHandler())
{

  Defaults = new RouteValueDictionary(new { action = "Index", id = "" }),

});

Replace it with the following route:

routes.MapRoute(
    "Default",                                      // Route name

    "{controller}/{action}/{id}",                   // URL with parameters

    new { controller = "Home", action = "Index", id = "" }  // Parameter defaults

);

Add the following line at the very beginning of the RegisterRoutes method:

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

Edit the Default.aspx file and add the following line:

<% Response.Redirect("~/Home") %>

This redirect is not necessary for IIS 7. This is a workaround for an issue with how the Web server that is built into Visual Studio (the ASP.NET Development Server) works with routing.

Configuration Changes In the Web.config file, you must change the type attribute of the httpHandler entry in the section for UrlRoutingHandler to System.Web.HttpForbiddenHandler.

To do this, search for the following string in the file:

path="UrlRouting.axd" type="System.Web.Routing.UrlRoutingHandler, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

Replace it with the following string:

path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Because the version numbers of the System.Web.Abstractions and System.Web.Routing assemblies have been changed to 0.0.0.0, you must update version information in the Web.config file. In the Web.config file, search for the following string:

System.Web.Routing, Version=3.5.0.0

Replace it with the following string:

System.Web.Routing, Version=0.0.0.0

Search for the following string:

System.Web.Abstractions, Version=3.5.0.0

Replace it with the following string:

System.Web.Abstractions, Version=0.0.0.0
mapache