System.Web.HttpException,显示“未找到类型服务”。在Mono ASP.NET Web服务中

时间:2015-11-21 09:11:04

标签: asp.net web-services exception mono

我在ubuntu 14.04中使用mono v4.2.1和apache2

我设法在网址http://myurl/WebService/Service.asmx

中安装我的ASP.NET网络服务

但是当我打开它时,我收到了这个错误:

System.Web.HttpException
Type Service not found.

Description: HTTP 500.Error processing request.
Details: Error processing request.
Exception stack trace:
  at System.Web.UI.SimpleWebHandlerParser.GetTypeFromBin (System.String tname) <0x40f053e0 + 0x00894> in <filename unknown>:0 
  at System.Web.Compilation.SimpleBuildProvider.LoadTypeFromBin (System.Web.Compilation.BaseCompiler compiler, System.Web.UI.SimpleWebHandlerParser parser) <0x40f053a0 + 0x00026> in <filename unknown>:0 
  at System.Web.Compilation.GenericBuildProvider`1[TParser].GetGeneratedType (System.CodeDom.Compiler.CompilerResults results) <0x40f05150 + 0x00085> in <filename unknown>:0 
  at System.Web.Compilation.BuildManagerCacheItem..ctor (System.Reflection.Assembly assembly, System.Web.Compilation.BuildProvider bp, System.CodeDom.Compiler.CompilerResults results) <0x40f04fc0 + 0x00101> in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.StoreInCache (System.Web.Compilation.BuildProvider bp, System.Reflection.Assembly compiledAssembly, System.CodeDom.Compiler.CompilerResults results) <0x40f04a60 + 0x0009f> 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) <0x40f00ff0 + 0x00b94> in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) <0x40ee7490 + 0x00579> in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) <0x40ee6df0 + 0x00149> in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) <0x40ee6a30 + 0x000b7> in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) <0x40ee65c0 + 0x00024> in <filename unknown>:0 
  at System.Web.UI.WebServiceParser.GetCompiledType (System.String inputFile, System.Web.HttpContext context) <0x40ee65a0 + 0x00014> in <filename unknown>:0 
  at System.Web.Services.Protocols.WebServiceHandlerFactory.GetCompiledType (System.String url, System.Web.HttpContext context) <0x40ee6570 + 0x00022> in <filename unknown>:0 
  at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler (System.Web.HttpContext context, System.String verb, System.String url, System.String filePath) <0x40edf510 + 0x0014a> in <filename unknown>:0 
  at System.Web.Script.Services.ScriptHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String pathTranslated) <0x40edf050 + 0x00241> in <filename unknown>:0 
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) <0x40ed71f0 + 0x002f3> in <filename unknown>:0 
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) <0x40ed71b0 + 0x00020> in <filename unknown>:0 
  at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () <0x40ebcf60 + 0x02b62> in <filename unknown>:0 

这是我的Service.asmx:

<%@ WebService Language="C#" Class="Service" %>

Service类位于一个库中,该库通过引用添加:

using System.Web.Services;

[WebService(Namespace = "http://myurl/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : WebService
{
    public Service()
    {
    }
}

关键是它在 Microsoft Visual Studio 中完全正常,但单声道有问题,我不知道在哪里看或做什么。

2 个答案:

答案 0 :(得分:1)

我发现这是因为没有正确设置根目录。

我使用了 xsp4 而不是 apache2 并修复了它。

答案 1 :(得分:0)

我认为单声道无法支持网络服务,亲爱的马丁看看这个问题:Running ASP.Net on a Linux based server

您也可以查看这篇文章:http://www.mono-project.com/docs/web/porting-aspnet-applications/