1

I'm having an existing event system solution where I'm using Tridion.ContentManager dll. And finally creating merged dll for event system using ILMerge. Its working fine if I'm using Web 8.5 dlls but i'm not able to create merged dll when using sites 9.1 Tridion.ContentManager dll with version "9.1.0.0". Here is the error we are getting :

An exception occurred during merging: Unresolved assembly reference not allowed: Tridion.ContentManager.Data. at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly) at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type) at System.Compiler.Ir2md.VisitReferencedType(TypeNode type) at System.Compiler.Ir2md.VisitClass(Class Class)

1 Answer 1

4

I had the same thing a while ago. It was caused by the command line argument '/closed' which I had added to the ilmerge call. This is described in the documentation (https://github.com/dotnet/ILMerge/blob/master/ilmerge-manual.md#26-closed).

In the documentation, they warn you that it's not an easy topic (but that is life). The way I understand it, in 'closed' mode ilmerge will try to resolve all dependencies in the DLLs which you are trying to merge. If one of those dependencies is not found, it will throw the error you are seeing. If you one of the DLLs you're trying to merge has a reference to one of the Tridion Content Manager client DLLs (like Tridion.ContentManager.dll), and you try to merge it on a machine which does not have the Tridion Content Manager installed, this will croak. Ilmerge will follow the reference to Tridion.ContentManager.dll (which is probably there in your bin folder, so that's fine). Then it goes from there to the references of this DLL. One of those is Tridion.ContentManager.Data.dll, which is installed in the GAC when you install the Tridion CM - but it's probably not in your bin folder because it is not part of the 'client DLLs' which you are supposed to use to build your event system, templates or custom resolvers.

If you do NOT use /closed, ILMerge will not follow the references from the DLLs you're merging to the Tridion client DLLs, and you should be good.

4
  • Thanks @Quirijn. this seems to have helped resolving the issue. But i'm little surprised, why its suddenly changed in sites 9.1 dlls only. Till Web 8.5, this seems to have worked without issues. Commented Feb 12, 2020 at 10:57
  • Could it be that before you were building on the Tridion server itself, and now you are building from your own PC?
    – Quirijn
    Commented Feb 12, 2020 at 13:42
  • No, i'm always building it from my machine where i don't have tridion server installed. Even now when tridion sites 9.1 dlls are failing with /close but if i replace with 8.5 dlls then it works fine. So i suspect something a miss with tridion.contentmanager dll for 9.1 Commented Feb 13, 2020 at 4:07
  • 1
    That's good to know. It's definitely a sign that something changed between these versions. But since the ability to merge other DLLs with Tridion DLLs is probably not considered a feature of Tridion, I doubt if it is worth bothering SDL Support about ;-)
    – Quirijn
    Commented Feb 13, 2020 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.