3

将我现有的 Tridion 2009 事件 DLL(在 2011 服务器上编译)添加到 bin 目录并在 Content Manager 配置文件中注册 DLL 后,GUI 现在返回以下错误。我已经检查了事件日志、Tridion 日志等以获取有关“缺少依赖项”的更多详细信息,有人有什么想法吗?

Could not load file or assembly 'Tridion.Extensions.Events, Version=1.0.20.521,
Culture=neutral, PublicKeyToken=ecb60dbe3cbb7440' or one of its dependencies. 
The system cannot find the file specified.

Unable to get LangID of User (tcm:0-2851-65552). Initialization of the extension
'C:\Program Files (x86)\Tridion\bin\Tridion.Extensions.Events.MDO.dll' failed.

System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly,ObjectHandleOnStack) 
    System.Reflection.RuntimeAssembly.GetExportedTypes() 
    Tridion.ContentManager.Extensibility.TcmExtension.LoadExtensions() 
    Tridion.ContentManager.Extensibility.TcmExtension.LoadExtensions() 
    Tridion.ContentManager.Extensibility.TcmExtension.InitializeExtensions() 
    Tridion.ContentManager.Extensibility.EventSystem.DeliverEvent(IEnumerable`1,TcmEventArgs,EventDeliveryPhase) 
    Tridion.ContentManager.Extensibility.EventSystem.DeliverEvent(IdentifiableObject,TcmEventArgs,EventDeliveryPhase) Tridion.ContentManager.IdentifiableObject.Load(LoadFlags,Boolean) 
    Tridion.ContentManager.IdentifiableObject.Load(LoadFlags) 
    Tridion.ContentManager.BLFacade.IdentifiableObjectFacade.Read(UserContext,String,XMLReadFilter) XMLState.GetPropertyElem XMLState.GetProperty User.LangID
4

2 回答 2

5

看起来你有两个程序集:Tridion.Extensions.Events.dllTridion.Extensions.Events.MDO.dll. 由于您通过 Tridion.ContentManager.config 中的完整路径引用 TcmExtension DLL,因此您不能在同一目录中拥有依赖于另一个的 TcmExtension DLL。

解决方案是将“共享库”(可能Tridion.Extensions.Events.MDO.dll为您)放在 GAC 中。

于 2012-05-10T00:21:33.290 回答
1

Fortunately, .NET assemblies contain all the dependency information you need in their metadata. Faced with this problem, I would generally try to open up the assembly with a tool that can read this, for example, ILDASM, or IlSpy. That gives you a concrete list of things to look for, instead of the vague and mysterious "or one of its dependencies".

An alternative approach is to use FUSLOGVW to monitor where the .NET runtime is looking for assemblies.

于 2012-05-10T06:46:04.690 回答