2012-04-03 20 views
0

我正在使用SDL Tridion 2011上的核心服務,從客戶機連接到Tridion服務器。我在嘗試解除它時遇到了一些錯誤。從客戶機訪問核心服務時出錯

示例代碼

namespace coreservice1 
{ 
    public partial class _Default : System.Web.UI.Page 
    { 
     protected void Page_Load(object sender, EventArgs e) 
     { 
      try 
      { 
       using (ChannelFactory<ISessionAwareCoreService> factory = new ChannelFactory<ISessionAwareCoreService>("wsHttp_2011")) 
       { 

        ISessionAwareCoreService client = factory.CreateChannel(); 
        ComponentData comp = (ComponentData)client.Create(component, new ReadOptions()); 

        ... 

        //steps to create component     

       } 
      } 
      catch (Exception ex) 
      { 
       Response.Write(ex.StackTrace); 
       Response.Write("exception is " + ex.Message); 
      } 
     } 
    } 
} 

我對wsHttp_2011的web.config是

<wsHttpBinding> 
    <binding name="wsHttp" transactionFlow="true" maxReceivedMessageSize="10485760"> 
     <readerQuotas maxStringContentLength="10485760" maxArrayLength="10485760"/> 
      <security mode="Message"> 
       <message clientCredentialType="Windows"/> 
      </security> 


<endpoint name="wsHttp_2011" address="http://serveraddress:1000/webservices/CoreService2011.svc/wsHttp" binding="wsHttpBinding" bindingConfiguration="wsHttp" contract="Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService"> 
    <identity> 
     <dns value="serveraddress"/> 
    </identity> 
</endpoint> 

錯誤:

Server Error in '/' Application. 
________________________________________ 
Could not load file or assembly 'Tridion.Logging' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) 

我的客戶端代碼referrring到Tridion.Logging。這個程序集存在於我的代碼中。無論其存在,我都會收到錯誤。並且我在客戶端代碼中引用的DLL版本與服務器中的版本完全相同。

任何人都可以幫忙,我需要做什麼改變?

我還檢查了tridion服務器中的事件日誌。我沒有在那裏找到任何日誌。

在服務器計算機上執行代碼時工作正常。

事件查看器日誌是這樣的,從客戶端機器:

ConfigurationErrorsException

Could not load file or assembly 'Tridion.Logging, Version=6.1.0.25, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() at System.Web.Compilation.BuildManager.CallPreStartInitMethods() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) Could not load file or assembly 'Tridion.Logging, Version=6.1.0.25, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) Could not load file or assembly 'Tridion.Logging' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() at System.Web.Compilation.BuildManager.CallPreStartInitMethods() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

我沒找到日誌在服務器上的任何事件。

+0

您看到異常,是否在服務器端的客戶端上?你在事件日誌中看到什麼?你能指定你使用的操作系統和體系結構嗎?你使用服務引用,還是CoreService.dll?你的客戶端與服務器在同一臺機器上嗎? – 2012-04-03 09:26:49

+0

我正在使用Coreservice.dll。我的客戶與服務器不一樣。這不一樣。 – Patan 2012-04-03 09:43:50

+0

using Tridion.ContentManager.CoreService.Client; using Tridion.ContentManager.ContentManagement.Fields; 使用Tridion.ContentManager.CommunicationManagement; using Tridion.ContentManager.ContentManagement; 使用System.Text; using Tridion.ContentManager.CoreService; using System.ServiceModel.Channels;使用System.IO的 ;使用System.Collections的 ; using System.Text.RegularExpressions; – Patan 2012-04-03 09:44:06

回答

4

您不應該參考Tridion.Logging。 CoreService不是必需的。所有你需要的是CoreService.dll。此外,Tridion.Logging不是公共API,因此根本不應使用

+0

即使我將其刪除,我也面臨着同樣的錯誤。 – Patan 2012-04-03 11:15:28

+0

請確保您所引用的唯一Tridion程序集是CoreService.dll – 2012-04-03 11:18:49

+0

錯誤不是Tridion.Logging丟失,而是「缺少其中一個依賴關係」 - 即Tridion。正如user978511所說,確保你只使用CoreService客戶端DLL。 – 2012-04-03 11:39:15

0

檢查Tridion事件日誌。還要確保你沒有使用任何其他的Tridion組件。

相關問題