Documentation Center

Management of C# fragment and .NET assembly Template Building Block logs

You can configure the logging performed during publishing so that you can examine the log messages produced by C# fragment Template Building Blocks and .NET assembly Template Building Blocks when you publish an item.

If you are working with a C# fragment Template Building Block and you are not able to debug the fragment, but you can get access to its log messages, you can make your C# fragment write its log messages to a specific log file and/or to a console.

Similarly, you may want to make your .NET assembly Template Building Block write its log messages to a specific log file and/or to a console If you are debugging a .NET assembly Template Building Block while publishing an item. Typically, you debug .NET Template Building Blocks by following the instructions in Debugging a Template. That is, you run a Template from the Template Builder client application and examine the Output window to see what, if anything, goes wrong during Template execution. You then use this information to set breakpoints in your .NET code, and debug the code.

However, some problems with your Template may only occur while you are publishing content. In that case, you can still attach your .NET project to the publish process (as explained in Debugging .NET assembly Template Building Blocks remotely), and set breakpoints in your .NET code, but since you are not using Template Builder, there is no Output view in which to examine the log messages produced by the .NET assembly Template Building Block being executed. You must access the log elsewhere.