问题
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?
回答1:
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
回答2:
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.
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.
On your client machine, start Visual Studio and open the .NET assembly project.
Also, start Template Builder and open or create a Compound Template.
Set a breakpoint somewhere in your code.
From the main menu, select Debug > Attach to Process .The Attach to Process dialog appears.
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.
回答3:
Days are passed and we are stepping into the future with more ideas and implementations day by day.
It's time to say bye to remote debugger host.
We have a new facility to debug all the tridion templates locally without connecting to remote debugger host which is called as "TcmDebugger".
SDL Tridion Content Manager .NET Templating Debugger
For more details, refer How to debug Tridion Templates without connecting to TcmTemplateDebugHost.exe
来源:https://stackoverflow.com/questions/12210711/tridion-template-builder-and-visual-studio-debugging