Mono - 域子文件夹中的 ASP.NET 应用程序

发布于 2024-12-02 07:10:47 字数 3474 浏览 1 评论 0原文

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

例如,以下单声道 .webapphttp://localhost/Service.asmx 上成功运行(因为我的 Web 应用程序位于 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 

我怎样才能成功地获得一个网络应用程序子文件夹?谢谢。

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.

For example, the following mono .webapp successfully works at http://localhost/Service.asmx (as my web app is in folder2):

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

However, due to a legacy URL, I need my web application to exist two subfolders deeper like so:

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

If I try to go to http://localhost/folder1/folder2/Service.asmx it fails with

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 

How can I successfully get a web app in subfolders? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

童话里做英雄 2024-12-09 07:10:47

事实证明,这是一个 Apache 配置问题,虽然不相关,但却产生了副作用。我的 VirtualHost 设置不正确。

Turns out this was an Apache configuration issue that was unrelated but caused this as a side effect. I had my VirtualHost setup incorrectly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文