Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tridion: Template Builder and Visual studio debugging

We are creating compound templates using Visual Studio 2008. While debugging, we attach to the process of template builder. However we are not able to locate the template builder process ID while attaching the process in VS 2008.

This works well on our dev server where VS 2008, CMS(Tridion 2011 SP1) and Template builder are on the same server. But doesn't works if the VS2008 and Template Builder are installed on a machine other than CMS server.

Is it a pre-requisite to have all (VS2008, Template builder and CMS) on same server especially for debugging?

like image 705
Huston Lopes Avatar asked Aug 31 '12 07:08

Huston Lopes


2 Answers

When you are on the local machine you can indeed directly connect to the TcmTemplateDebugHost.exe process, but remotely Visual Studio has a built-in solution you can use.

It is described in the documentation here (login required, see http://docportal.sdl.com/sdltridion for details) and more details on how to set up remote debugging in Visual Studio can be found on msdn

like image 115
Bart Koopman Avatar answered Sep 24 '22 20:09

Bart Koopman


As Bart suggested,you can take a help of documentation. To set up remote debugging for 2011 SP1 is very similar to 2009. if you have "SDL Tridion 2009 Templating manual",you can refer it at page -82(Section 7.3.6). below are steps which it suggests for same --

Steps to execute 1. Access the machine on which the Content Manager server runs.

  1. From this machine, remotely start the Visual Studio Remote Debugging Monitor, an executable called msvsmon.exe, located on the client machine on which you created your .NET assembly. This executable is located in the folder: c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ Remote Debugger\\ where is the architecture of the CPU on your client machine (either x64, ia64, or x86). You can choose to share this folder so that the Content Manager server machine can access it. Be sure to run this executable as the user who is running Visual Studio on the client machine (for example, you can do this from the Windows command line prompt using the runas command). This user must be a local administrator on the Content Manager server machine.

  2. On your client machine, start Visual Studio and open the .NET assembly project.

  3. Also, start Template Builder and open or create a Compound Template.

  4. Set a breakpoint somewhere in your code.

  5. From the main menu, select Debug > Attach to Process .The Attach to Process dialog appears.

  6. In this dialog: • For Qualifier, fill in the name of the Content Manager server machine, for example, username@TCMSERVER, where username is the name of the user who is running msvsmon.exe. Then click Refresh at the bottom of the dialog. The Available Processes table now displays processes running on the Content Manager server machine. • In this table, locate the running process called TcmTemplateDebugHost. In that case, identify your specific instance of this process by checking the ID. You can find out the ID of your process by checking the Output view in Template Builder, which contains the following line:

Debugging was started in process 'TcmTemplateDebugHost' with ID 7728 where 7728 is the ID of the process.

like image 37
Ram Saurabh Avatar answered Sep 23 '22 20:09

Ram Saurabh