繁体   English   中英

从WCF Windows主机中的其他文件夹加载WCF服务

[英]Loading WCF Service from different folder in WCF Windows host

我想从WCF Windows host.EXE文件加载WCF服务dll。 但是WCf Service.dll存储在其他文件夹中。

资料夹结构:

\@root\Service\WCFService.dll (this is service)
\@root\Host\WCFHost.exe (this is host exe)
\@root\Host\WCFHost.exe.config (this is host exe configuration)

<services>
   <service name="XXX.Service">
      <endpoint address="http" binding="basicHttpBinding" contract="XXX.IService" />
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      <host>
         <baseAddresses>
            <add baseAddress="http://localhost:8035/Service" />
         </baseAddresses>
      </host>
   </service>
<services>

当我启动Windows服务时,出现以下错误:

服务无法启动。 System.IO.FileNotFoundException:无法加载文件或程序集“ XXX.Service,版本= 1.0.0.0,区域性=中性,PublicKeyToken =空”或其依赖项之一。 该系统找不到指定的文件。 文件名:“ XXX.Service,版本= 1.0.0.0,区域性=中性,PublicKeyToken =空”。

在此先感谢Nizam

假设代码示例中的XXX是服务实现的完全限定名称空间,那么这里有一些建议:

  • WCFService.dll的依赖项与exe或GAC不在同一个目录中。
  • 您正在生成host.exe的签名版本,该版本试图加载WCFService.dll的未签名版本
  • ???

暂无
暂无

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

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