title: Mono - ASP.NET Application in domain Subfolder
body: <p>I have an Apache server with mod_mono hooked up to a legacy ASP.NET application. I can't seem to get this application to work if I move it from a top level folder. </p>
  
  <p>For example, the following mono <code>.webapp</code> successfully works at <code>http://localhost/Service.asmx</code> (as my web app is in <code>folder2</code>):</p>
  
  <pre><code>&lt;apps&gt;
  &lt;web-application&gt;
                  &lt;name&gt;Test&lt;/name&gt;
                  &lt;vpath&gt;/&lt;/vpath&gt;
                  &lt;path&gt;/srv/aspnettest/folder1/folder2&lt;/path&gt;
                  &lt;vhost&gt;localhost&lt;/vhost&gt;
          &lt;/web-application&gt;
  &lt;/apps&gt;
  </code></pre>
  
  <p>However, due to a legacy URL, I need my web application to exist two subfolders deeper like so:</p>
  
  <pre><code>&lt;apps&gt;
  &lt;web-application&gt;
                  &lt;name&gt;Test&lt;/name&gt;
                  &lt;vpath&gt;/&lt;/vpath&gt;
                  &lt;path&gt;/srv/aspnettest/&lt;/path&gt;
                  &lt;vhost&gt;localhost&lt;/vhost&gt;
          &lt;/web-application&gt;
  &lt;/apps&gt;
  </code></pre>
  
  <p>If I try to go to <code>http://localhost/folder1/folder2/Service.asmx</code> it fails with </p>
  
  <pre><code>HTTP 500. Error processing request.
  
  Stack Trace:
  
  System.Web.HttpException: Type MyType.Service not found.
    at System.Web.UI.SimpleWebHandlerParser.GetTypeFromBin (System.String tname) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.SimpleBuildProvider.LoadTypeFromBin (System.Web.Compilation.BaseCompiler compiler, System.Web.UI.SimpleWebHandlerParser parser) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.GenericBuildProvider`1[TParser].GetGeneratedType (System.CodeDom.Compiler.CompilerResults results) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.BuildManagerCacheItem..ctor (System.Reflection.Assembly assembly, System.Web.Compilation.BuildProvider bp, System.CodeDom.Compiler.CompilerResults results) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.BuildManager.StoreInCache (System.Web.Compilation.BuildProvider bp, System.Reflection.Assembly compiledAssembly, System.CodeDom.Compiler.CompilerResults results) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler (System.Web.HttpContext context, System.String verb, System.String url, System.String filePath) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in &lt;filename unknown&gt;:0 
    at System.Web.HttpApplication+&lt;Pipeline&gt;c__Iterator2.MoveNext () [0x00000] in &lt;filename unknown&gt;:0 
  </code></pre>
  
  <p>How can I successfully get a web app in subfolders? Thanks.</p>