简体   繁体   English

WCF服务发布和无文件激活:仍创建一个.svc文件

[英]WCF Service Publishing and Fileless Activation : still create a .svc file

Using Visual Studio 2012, I have created a WCF 4.5 Service Library. 使用Visual Studio 2012,我创建了WCF 4.5服务库。 When the service is published to my local IIS, despite the serviceActivations section in the configuration file, a .svc file is still created. 服务发布到我的本地IIS时,尽管配置文件中有serviceActivations部分,仍会创建一个.svc文件。

I'm also using a custom factory in the configuration file, which, fortunately, isn't lost because serviceActivations overrides .svc files. 我还在配置文件中使用了自定义工厂,幸运的是,它没有丢失,因为serviceActivations覆盖了.svc文件。

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 : 创建的.svc文件是这样的:

<%@ 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. 任何帮助表示赞赏。

The .svc file is created because the service isn't declared in the configuration node. 由于未在配置节点中声明服务,因此创建了.svc文件。 As soon as I've added the service, the file creation is gone. 添加服务后,文件创建就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM