我正在使用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)
我的客户端代码是指Tridion.Logging。这个程序集存在于我的代码中。无论它存在,我都会收到错误。我在客户端代码中引用的DLL版本与服务器中的版本完全相同。
任何人都可以帮忙,我需要做些什么改变?
我还检查了tridion服务器中的事件日志。我没有在那里找到任何日志。
在服务器计算机上执行代码时工作正常。
事件查看器日志与客户端计算机类似:
ConfigurationErrorsException
无法加载文件或程序集'Tridion.Logging,Version = 6.1.0.25,Culture = neutral,PublicKeyToken = ddfc895746e5ee6b'或其中一个依赖项。强名称签名无法验证。程序集可能已被篡改,或者是延迟签名但未使用正确的私钥完全签名。 (来自HRESULT的异常:0x80131045)System.Web.Configuration.Seilation上的System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)中的System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()位于System.Web.HostingEnvironment.Initialize(ApplicationManager)上的System.Web.Compilation.BuildManager.CallPreStartInitMethods()的System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()中的System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)处appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException)无法加载文件或程序集'Tridion.Logging,Version = 6.1.0.25,Culture = neutral,PublicKeyToken = ddfc895746e5ee6b'或其依赖项之一。强名称签名无法验证。程序集可能已被篡改,或者是延迟签名但未使用正确的私钥完全签名。 (来自HRESULT的异常:0x80131045)System.Reflection.RuntimeAssembly.nLoad(System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark&amp; stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks))在System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,Evidence assemblySecurity,StackCrawlMark&amp; stackMark,Boolean forIntrospection,Boolean suppressSecurityChecks)上的AssemblyName fileName,String codeBase,Evidence assemblySecurity,RunCAssembly locationHint,StackCoplMark&amp; stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks) System.Sv.Configuration上System.Reflection.Assembly.Load(String assemblyString)的System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,Evidence assemblySecurity,StackCrawlMark&amp; stackMark,Boolean forIntrospection) .CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)无法加载文件或程序集“Tridion.Logging”或其依赖项之一。强名称签名无法验证。程序集可能已被篡改,或者是延迟签名但未使用正确的私钥完全签名。 (HRESULT的例外情况:0x80131045)
System.Web.Compilation上的System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)中的System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()处的System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective)。 System.Web.Compos.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory)上的System.Web.Comp.Manager.Compilation.BuildManager.CallPreStartInitMethods()中的System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()中的BuildManager.GetReferencedAssemblies(CompilationSection compConfig) ,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException)
我在服务器的日志中找不到任何事件。
答案 0 :(得分:4)
你不应该参考Tridion.Logging。 CoreService不需要它。您只需要CoreService.dll。此外,Tridion.Logging不是公共API,因此不应该全部使用
答案 1 :(得分:0)
检查Tridion事件日志。另外,请确保您没有使用任何其他Tridion程序集。