使用Visual Studio 2012,我创建了一个WCF 4.5服务库。 将服务发布到本地IIS时,尽管配置文件中包含serviceActivations部分,仍会创建.svc文件。
我也在配置文件中使用自定义工厂,幸运的是,它不会丢失,因为serviceActivations会覆盖.svc文件。
配置文件如下所示:
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"> <serviceActivations> <add factory="My.ServiceHostFactory" relativeAddress="~/BirtProxy.SoapReport.svc" service="BirtProxy.SoapReport" /> </serviceActivations> </serviceHostingEnvironment>创建的.svc文件是这样的:
<%@ ServiceHost Service="BirtProxy.SoapReport" %>我有其他一些服务,我没有这种行为,但我无法弄清楚是什么问题。 我不希望创建这个附加文件。
任何帮助赞赏。
Using Visual Studio 2012, I have created a WCF 4.5 Service Library. When the service is published to my local IIS, despite the serviceActivations section in the configuration file, a .svc file is still created.
I'm also using a custom factory in the configuration file, which, fortunately, isn't lost because serviceActivations overrides .svc files.
The configuration file look like this :
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"> <serviceActivations> <add factory="My.ServiceHostFactory" relativeAddress="~/BirtProxy.SoapReport.svc" service="BirtProxy.SoapReport" /> </serviceActivations> </serviceHostingEnvironment>The .svc file that is created is like this :
<%@ ServiceHost Service="BirtProxy.SoapReport" %>I have several other services where I don't have this behavior, but I can't figure out what's wrong. I don't want this additional file to be created.
Any Help appreciated.
最满意答案
创建.svc文件是因为未在配置节点中声明服务。 一旦我添加了服务,文件创建就消失了。
The .svc file is created because the service isn't declared in the configuration node. As soon as I've added the service, the file creation is gone.
更多推荐
发布评论