1

我有一个 Apache 服务器,其 mod_mono 连接到旧版 ASP.NET 应用程序。如果我从顶级文件夹中移动它,我似乎无法让这个应用程序工作。

例如,以下单声道.webapp成功地工作http://localhost/Service.asmx(因为我的网络应用程序在folder2):

<apps>
<web-application>
                <name>Test</name>
                <vpath>/</vpath>
                <path>/srv/aspnettest/folder1/folder2</path>
                <vhost>localhost</vhost>
        </web-application>
</apps>

但是,由于旧 URL,我需要我的 Web 应用程序存在两个更深的子文件夹,如下所示:

<apps>
<web-application>
                <name>Test</name>
                <vpath>/</vpath>
                <path>/srv/aspnettest/</path>
                <vhost>localhost</vhost>
        </web-application>
</apps>

如果我尝试去http://localhost/folder1/folder2/Service.asmx它失败

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 <filename unknown>:0 
  at System.Web.Compilation.SimpleBuildProvider.LoadTypeFromBin (System.Web.Compilation.BaseCompiler compiler, System.Web.UI.SimpleWebHandlerParser parser) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.GenericBuildProvider`1[TParser].GetGeneratedType (System.CodeDom.Compiler.CompilerResults results) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManagerCacheItem..ctor (System.Reflection.Assembly assembly, System.Web.Compilation.BuildProvider bp, System.CodeDom.Compiler.CompilerResults results) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.StoreInCache (System.Web.Compilation.BuildProvider bp, System.Reflection.Assembly compiledAssembly, System.CodeDom.Compiler.CompilerResults results) [0x00000] in <filename unknown>: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 <filename unknown>:0 
  at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler (System.Web.HttpContext context, System.String verb, System.String url, System.String filePath) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext () [0x00000] in <filename unknown>:0 

如何在子文件夹中成功获取 Web 应用程序?谢谢。

4

1 回答 1

0

原来这是一个不相关的 Apache 配置问题,但这是一个副作用。我的 VirtualHost 设置不正确。

于 2011-09-02T00:45:35.897 回答