I am trying to debug a Custom Template Building Block defined in a .Net Assembly TBB according to the documentation. I am building the .Net Assembly using below command in the Post Build event of the solution.

  "$(SolutionDir)tools\ilmerge" /lib:" C:\Windows\Microsoft.NET\Framework\v4.0.30319" /lib:"$(SolutionDir)Dependencies" /t:dll /targetplatform:v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319 /out:"$(TargetDir)$(TargetName).merged.dll" "$(TargetDir)DD4T.Templates.Base.dll" "$(TargetDir)DD4T.ContentModel.Contracts.dll" "$(TargetDir)DD4T.ContentModel.dll" "$(TargetDir)DD4T.ContentModel.XmlSerializers.dll" "$(TargetDir)DD4T.Serialization.dll" "$(TargetDir)Newtonsoft.Json.dll" "$(TargetPath)"

The merged DLL with PDB file generated successfully. But when I upload the merged dll to the TBB and try to debug in visual studio, no breakpoint is being hit, it says "The breakpoint will not currently be hit. No symbols have been loaded for this document.”

On the other hand, If I DON'T merge the Templating DLL before uploading and register the other dependency DLLs (I used to merge before) in GAC, The debugging works as expected.

Can someone help me, if I am missing anything during ILMerge or after?

  • 1
    Does it work when you manually load the symbols from the pdb file (as explained here : msdn.microsoft.com/en-us/library/ms241613.aspx) – Harald Hoffelinck Jul 30 '18 at 14:52
  • Thanks Harald, Looks like it doesn't help. The PDB file actually resides inside the project directory itself and it should load this by default at first place. – Saurabh Gangwar Jul 30 '18 at 15:22
  • 1
    Hi Saurabh, Can you put that updated dll into the tridion_home\bin folder along with pdb file and upload that from there. Then attach the service and try to debug it ? I know this is a workaround, but it works for me. – Sayantan Basu Jul 30 '18 at 16:42
  • Hm, manually loading of the pdb file should work. Stupid question, have you uploaded a debug build of the merged dll? – Atila Sos Jul 30 '18 at 17:11
  • Yeah Atila, I uploaded the debug build. – Saurabh Gangwar Jul 31 '18 at 5:21

Thanks all for the answers and comments. But it was a silly mistake from my side, So to upload the DLL (and other TBBs) in Tridon I was using the command below

TcmUploadAssembly.exe config.xml "MyMergedAssembly.dll"

For some reasons in config.xml, I had "uploadPDB" set to false like this <uploadPDB>false</uploadPDB>, so PDB wasn't getting uploaded to Tridion and That's why it wasn't debugging.

Once I set "uploadPDB" to true, upload and debug, it works like a charm.

| improve this answer | |

Yes, that is the point. You are trying to remotely debug one dll, but in fact you have another one uploaded (if ita merged via ilmerge, its different dll, has different signature).

So, to answer why it works via GAC upload, its because you upload correct one, and that one you are testing. If you just test it, then GAC upload is ok, but please make sure to remove once its finished.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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