未调用ServiceHostFactory

时间:2011-03-22 14:00:58

标签: c# .net wcf

我有一个ASP.Net托管服务主机:

<%@ ServiceHost Language="C#" Debug="true" 
    Service="LongTermStorage.WebService.LongTermStorageService" 
    Factory="LongTermStorage.WebService.SteelServiceHostFactory"
    CodeBehind="LongTermStorageService.svc.cs" %>

SteelServiceHostFactory未被调用,我没有收到任何错误。

厂:

public class SteelServiceHostFactory : ServiceHostFactory
{
    protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
    {
        return new SteelServiceHost(SteelWcfApplication.InstanceProvider, serviceType, baseAddresses);
    }
}

1 个答案:

答案 0 :(得分:0)

如果我从Cassini(开发Web服务器)切换到IIS,它就可以工作。