title: Problems with Mono, MVC, and FastCGI
body: <p>I have two websites that I have created with Mono.NET. Both were built exclusively using Xamarin Studio (e.g. MonoDevelop).  The first is a standard Asp.NET webforms application and the second is an Asp.NET MVC application.  </p>
  
  <p>I have deployed the first application to my RedHat 7 server successfully.  The server is running NGINX as the pass through and leverages FastCGI.  The web application itself is run at the root (/var/www/html/) and thus pointing to <a href="http://[myserver].com/" rel="nofollow">http://[myserver].com/</a> kicks of the application.  This all works beautiful.</p>
  
  <p>My second application (the MVC one) should run as a sort of virtual directory of the root.  So pointing to <a href="http://[myserver].com/admin/" rel="nofollow">http://[myserver].com/admin/</a> should access the MVC application.  This has been configured correctly on the server and when you point to <a href="http://[myserver].com/admin" rel="nofollow">http://[myserver].com/admin</a>, it clearly attempts to start the MVC application.</p>
  
  <p>My problem is that trying to access <a href="http://[myserver].com/admin" rel="nofollow">http://[myserver].com/admin</a>, throws an application exception:  </p>
  
  <pre><code>System.Web.Compilation.ParseException
  Cannot find type Letters.Web.Admin.MvcApplication
  
  Description: Error parsing a resource required to service this request. Review your source file and modify it to fix this error.
  Details: Cannot find type Letters.Web.Admin.MvcApplication
  Error origin: Parser
  Error source file: /var/www/html/admin/Global.asax
  
  Error source context:
  Error lines: 1, 1
  1: &lt;%@ Application CodeBehind="Global.asax.cs" Inherits="Letters.Web.Admin.MvcApplication" Language="C#" %&gt;
  </code></pre>
  
  <p>I've been googling about this error for 2 days with no luck.  I have double checked to make sure the /bin directory exists in the /admin folder (it does) and that all of the appropriate .dll files are present including the web application dll (also present).  I have made sure my Global.asax has the appropriate declaration (it does ... see below)</p>
  
  <pre><code>&lt;%@ Application CodeBehind="Global.asax.cs" Inherits="Letters.Web.Admin.MvcApplication" Language="C#" %&gt;
  </code></pre>
  
  <p>I have also made sure the namespace is correct in the codebehind (it is... see below)</p>
  
  <pre><code>namespace Letters.Web.Admin
  {
      public class MvcApplication : System.Web.HttpApplication
      {
          public static void RegisterRoutes (RouteCollection routes)
          {
              routes.IgnoreRoute ("{resource}.axd/{*pathInfo}");
  
              routes.MapRoute (
                  "Default",
                  "{controller}/{action}/{id}",
                  new { controller = "Home", action = "Index", id = "" }
              );
  
          }
  
          public static void RegisterGlobalFilters (GlobalFilterCollection filters)
          {
              filters.Add (new HandleErrorAttribute ());
          }
  
          protected void Application_Start ()
          {
              AreaRegistration.RegisterAllAreas ();
              RegisterGlobalFilters (GlobalFilters.Filters);
              RegisterRoutes (RouteTable.Routes);
          }
      }
  }
  </code></pre>
  
  <p>I cannot for the life of me figure out the issue.  Everything appears to be functioning correctly.  This application runs fine on my mac using Xamarin studio.  I've double checked and I have the same version of mono installed on my mac as I do on the server.  I'm guessing there is probably something else going on that is being obfuscated by this error but for the life of me, I can't figure out the issue.  Does anyone have any ideas?</p>