title: Web Form Routing - Cannot create an abstract class
body: <p>Net 3.5 SP1 and attempting to implement a sample copy of <a href="http://haacked.com/archive/2008/03/11/using-routing-with-webforms.aspx" rel="nofollow noreferrer">http://haacked.com/archive/2008/03/11/using-routing-with-webforms.aspx</a> into a sample web application however I seem to be having some issues.</p>
  
  <p>I am running windows vista, IIS 7.0, integrated-mode.</p>
  
  <p>Below is the YSOD:</p>
  
  <blockquote>
    <p>Cannot create an abstract class.</p>
    
    <p><strong>Description:</strong> An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
    
    <p><strong>Exception Details:</strong> System.MissingMethodException: Cannot create an abstract class.</p>
    
    <p><strong>Source Error:</strong> An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</p>
    
    <p><strong>Stack Trace:</strong> [MissingMethodException: Cannot create an abstract class.]
       System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandle&amp; ctor, Boolean&amp; bNeedSecurityCheck) +0
       System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
       System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
       System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
       System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
       System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
       System.Web.Configuration.HandlerFactoryCache..ctor(String type) +57
       System.Web.HttpApplication.GetFactory(String type) +78
       System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +229
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155</p>
  </blockquote>
  
  <p>I have an interface which looks like so:</p>
  
  <pre><code>public interface IRoutablePage : IHttpHandler
  {
      UrlHelper Url { get; }
      HtmlHelper Html { get; }
      RequestContext RequestContext { get; set;}
  }
  </code></pre>
  
  <p>I have an abstract class (RoutablePage) which inherits this interface and System.Web.UI.Page.</p>
  
  <p>I then have a web page (attached to a masterpage) which inherits the RoutablePage class.</p>
  
  <p>I have routes setup in my web config and when I try and access <a href="http://local.url/pageName" rel="nofollow noreferrer">http://local.url/pageName</a> I experience the YSOD with the information above.</p>
  
  <p>Can anyone help solve this issue please?</p>
  
  <p>Cheers</p>