次の方法で共有


Tracing issue with Visual Basic 2005 version of CAB

While we were working on the Visual Basic 2005 Hands On Labs for CAB, we discovered an issue with the ObjectBuilder implementation included in the December 2005 CAB release that makes Tracing of ObjectBuilder fail when it is enabled.

The problem is located in the BuilderStrategy class, which is a helper to write ObjectBuilder strategies by providing a base with a set of common and useful methods.

One of these methods, TraceBuildUp, is used to trace debugging information, if there is an appropriate policy; and there's a small issue in it.

To fix the problem in this method, you need to open the BuilderStrategy.vb file and replace the line 89 with the code indicated below. You might have noticed that the original code is closing a parenthesis incorrectly, and this is only noticeable on runtime when the TRACE constant is checked and tracing is enabled for ObjectBuilder.

policy.Trace(My.Resources.BuilderStrategyTraceBuildUp, Me.GetType().Name, typeToBuild.Name, IIf(idToBuild Is Nothing, "(null)", ""), message)

Finally, if you want to enable tracing at all, go to ObjectBuilder's project properties, select the Compile tab and verify that the TRACE constant is checked.

By the way, the Hands On Labs are ready now and in the queue to being published on MSDN (both, C# and Visual basic 2005).

Comments