At the beginning of your application, your must add a TextWriterTraceListener to the Listeners list of the Debug class.
Module Module1
Sub Main()
Debug.Listeners.Add(New TextWriterTraceListener("Debug of " & DateTime.Now.ToString() & ".txt"))
D...