2012-02-17 29 views
0

我想從WCF Windows host.EXE文件加載WCF服務DLL。但WCf Service.dll存儲在其他文件夾中。從WCF Windows主機中的不同文件夾加載WCF服務

文件夾結構:

\@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> 

當我開始我的窗口服務,我收到以下錯誤:

Service cannot be started. System.IO.FileNotFoundException: Could not load file or assembly 'XXX.Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'XXX.Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

由於事先 尼扎姆

+0

您是否找到原因? – 2012-02-21 16:49:17

回答

0

在你的代碼假設XXX sample是服務實現的完全限定名稱空間,那麼這裏有一些建議:

  • WCFService.dll的依賴關係不在與exe或GAC相同的目錄中。
  • 您正在生成正在嘗試加載未簽名版本的WCFService.dll的簽名版本的host.exe
  • ???
+0

感謝您的快速回復 – Nizam 2012-02-19 04:10:24

+0

感謝您的快速回復..是XXX是命名空間,所有依賴項都在\ Service文件夾中。host.exe和service.dll未簽名。 – Nizam 2012-02-19 04:18:20