[Mono-dev] mono 2.10.2 Mod_Mono WCF and tag Factory

tartafe felix.wordwarrior at gmail.com
Mon Aug 1 05:09:17 EDT 2011

i want publish a WCF unsing mod_mono on apache.

When i add the factory tag to my svc declaration i have this error after an
apache restart(on windows this service with factory works):

Could not load type 'WcfService2.Service1HostFactory' from assembly
'WcfService2, Version=, Culture=neutral, PublicKeyToken=null'.

Description: HTTP 500. Error processing request.

Stack Trace:

System.TypeLoadException: Could not load type
'WcfService2.Service1HostFactory' from assembly 'WcfService2,
Version=, Culture=neutral, PublicKeyToken=null'.
  at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetType
  at System.Reflection.MonoAssembly.GetType (System.String name, Boolean
throwOnError, Boolean ignoreCase) [0x00000] in <filename unknown>:0 
  at System.Reflection.Assembly.GetType (System.String name, Boolean
throwOnError) [0x00000] in <filename unknown>:0 
(System.String typeName) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.SvcHttpHandlerFactory.LoadTypeFromSvc
(System.String path, System.String url, System.Web.HttpContext context)
[0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.SvcHttpHandlerFactory.GetHandler
(System.Web.HttpContext context, System.String requestType, System.String
url, System.String pathTranslated) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url, Boolean ignoreContextHandler) [0x00000] in <filename
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication+<Pipeline>c__Iterator6.MoveNext () [0x00000]
in <filename unknown>:0 

this  is the content of my svc file:

<%@ ServiceHost Language="C#" Debug="true" Service="WcfService2.Service1,
WcfService2" CodeBehind="Service1.svc.cs"
Factory="WcfService2.Service1HostFactory, WcfService2"  Debug="true" %>

and this is my Service1HostFactory class:

namespace WcfService2
   public class Service1HostFactory : ServiceHostFactory
        public override ServiceHostBase CreateServiceHost(string
constructorString, Uri[] baseAddresses)
            return base.CreateServiceHost(constructorString, baseAddresses);

in mod_mono.conf i have added this two line:

MonoServerPath "/usr/bin/mod-mono-server4"
AddType application/x-asp-net .svc

View this message in context: http://mono.1490590.n4.nabble.com/mono-2-10-2-Mod-Mono-WCF-and-tag-Factory-tp3709207p3709207.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

More information about the Mono-devel-list mailing list