4

I modified the code of DD4T Templates projects and I generated all the dll files.

The next step is to join it in DD4T.Templates.merged.dll using ILMerge. I see in the project a file to build the targets, but it's not working in my computer and I tried for two days to fix it without any result.

Then, I want to merge the files manually using IlMerge. Which files I have to include in DD4T.Templates.merged.dll?

Thank you.

2
  • ILMerge is notorious for not being able to combine DLLs when it cannot find the references of these DLLs, to solve that you can use the /lib: command line parameter to point to these missing references (like the .NET framework etc.). But what error are you exactly getting? Commented Nov 3, 2015 at 11:38
  • Do we know how to do the same for Tridion sites 9.5? Commented Sep 11, 2021 at 10:41

1 Answer 1

6

According to the post-build script these are the dlls to merge:

  • DD4T.ContentModel.Contracts.dll
  • DD4T.ContentModel.dll
  • DD4T.Templates.Base.dll
  • DD4T.ContentModel.XmlSerializers.dll
  • DD4T.Serialization.dll
  • Newtonsoft.Json.dll
  • DD4T.Templates.dll

Rebuilding the DD4T.Templates project should trigger the post-build script to also merge the above dlls into DD4T.Templates.merged.dll.

By the way, which steps did you take and what errors did you get?


UPDATE

In current release (DD4T 2.0.2-beta) of DD4T.TridionTemplates things are setup differently.

These are the steps I took to make things work.

  1. Download the DD4T.TridionTemplates

    Get it here https://github.com/dd4t/DD4T.TridionTemplates (I downloaded the master zip file, unblocked the zip, then unzipped)

  2. Copy the Tridion dependencies DLLs

    Copy the Tridion 2011 SP1 and Tridion 2013 SP1 dlls to these respective folders:

    • DD4T.TridionTemplates\dependencies\SDL Tridion Templating 2011 SP1
    • DD4T.TridionTemplates\dependencies\SDL Tridion Templating 2013 SP1
  3. Download and install MSBuild Community Tasks

    This can be downloaded here: https://github.com/loresoft/msbuildtasks/releases

  4. Download and install ILMerge.msi

    This can be downloaded here: http://www.microsoft.com/en-us/download/details.aspx?id=17630

    The installation of ILMerge.msi is necessary because the ILMerge wrapper built into MSBuild Community Tasks expects the ILMerge.exe to locate in its standard installation path.

  5. Open and recompile the DD4T Templates.sln

    Recompile this solution will create a zip file DD4T.Templates.2.0.3-alpha1.zip in this location:

    DD4T.TridionTemplates\build\DD4T.Templates.2.0.3-alpha1.zip

    This zip contains files such as DD4T.Templates.Merged.dll and TcmUploadAssembly.exe.

    You now have everything you need to upload the merged dll.

2
  • I think I change something that is not launching the post-build script. It was failing in the ILMerge.task step but now I cannot execute it. Now it's not launching these tasks.
    – Guskermitt
    Commented Nov 3, 2015 at 11:44
  • By the way, my answer above was based on an older version of the DDT4.Templates. I see now that the current release/source has changed. I also ran into an ILMerge error which I fixed by installing ILMerge.msi which can be downloaded here: microsoft.com/en-us/download/details.aspx?id=17630
    – hoang
    Commented Nov 3, 2015 at 13:41

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.