Matin Lotfaliee
Matin Lotfaliee

Reputation: 1615

System.Web.HttpException with "Type Service not found." in Mono ASP.NET Web Service

I am using mono v4.2.1 and apache2 in ubuntu 14.04

I managed to install my ASP.NET web service in the url: http://myurl/WebService/Service.asmx

But when I open it, I receive this error:

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 

This is my Service.asmx:

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

And the Service class is in a library which is added by reference:

using System.Web.Services;

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

The point is it works completely OK in Microsoft Visual Studio but mono has a problem and I don't know where to look or what to do.

Upvotes: 2

Views: 1166

Answers (1)

Matin Lotfaliee
Matin Lotfaliee

Reputation: 1615

I figured out that it was because the root directory was not correctly set.

I used xsp4 instead of apache2 and it fixed.

Upvotes: 1

Related Questions