IIS Manager Enable PUT DELETE Methods, REST

Recently I’ve been working with some of the newer IIS7/7.5 and using the IIS Manager, which happens to be quit nice.  They’ve done a great job at simplifying management from a IT perspective as well as a development perspective.  I ran into some trouble while trying to use the PUT and DELETE verbs in a ASP.NET MVC site.  I’m a bit of a purist, to some extent, and like to use the verbs for what they mean.  I kept getting a request not accepted using the PUT and DELETE verbs.  It turns out that you need to remove the WebDAV from the HttpHandlers and HttpModules which can easily be found in the IIS manager. Below shows a screen shot of the management view and the 2 location where you need to remove the WebDAV to enable PUT and DELETE methods.

image

Deploy ASP.NET MVC Dependencies to Hosting Provider

Lately I’ve been working with Visual Studio 2010 and have been quite impressed by some of it’s features.   One feature in particular is the web site publishing capabilities.  The other day I was trying to frantically get a school project done and needed to deploy to my hosting provider, WinHost.  I have to briefly say that I’ve worked with a few top name providers that host ASP.NET and this one has been the best with great how-to’s on up-to-date technologies like Visual Studio Web Deploy and has a awesome management console.  Anyway, that’s not what I came to write about.  So after I deploy my code with a snap using Web Deploy, I get a few errors when trying to run my site.  Here I was all stoked that the Web Deploy was so effortless, to come to message like “Could not load file or assembly System.Web.WebPages.Razor” and “Could not load file or assembly System.Web.Helpers”.  Man what a buzz kill.  So not all hosting providers have ASP.NET MVC 3 yet (i.e. loaded in the GAC on there servers) which obviously we can’t do.  There are a couple of ways to fix this.  One is to grab the dlls listed below and store them in some library folder from which you can reference in your project.  The alternative, and better approach, is to indicate that your references you already have should be set to “Copy local”.  I’ve provided a screen shot and a list off the dlls which are needed by a ASP.NET MVC 3 application.  If you’re doing a MVC 2 or you will not need all these dlls.

image

DLLs needed:

  • Microsoft.Web.Infrastructure
  • System.Web.Abstractions
  • System.Web.Helpers
  • System.Web.Mvc
  • System.Web.Razor
  • System.Web.Routing
  • System.Web.WebPages
  • System.Web.WebPages.Razor

You may be wondering why your project doesn’t have all these references.  No sweat.  You can just add them.  I like to install Visual Studio Productivity Power Tools, it makes the add reference experience nicer.  Once you have the DLLs referenced in you project, right click the ones listed above and select Properties.  Set the “Copy local” attribute to true, see image below.  That’s it, redeploy your site and you’re set!

image