WCF服务发布和无文件激活:仍然创建.svc文件(WCF Service Publishing and Fileless Activation : still create a .svc file)

编程入门 行业动态 更新时间:2024-10-28 07:27:19
WCF服务发布和无文件激活:仍然创建.svc文件(WCF Service Publishing and Fileless Activation : still create a .svc file)

使用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.

更多推荐

本文发布于:2023-08-04 10:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1414131.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   Service   svc   WCF   Publishing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!