Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 17: When Things Don’t Go Quite Right > Tracing LightSwitch Applications

Tracing LightSwitch Applications

During design time, you can use the debugger to find and fix problems in your code. Once you deploy your application, what can you do to diagnose any problems you might encounter?

Fortunately, the tracing features built into LightSwitch can help you. You can use this to instrument and monitor the applications you have deployed. Microsoft.LightSwitch.Trace is the class that you would use to perform trace-related activities. This class contains three methods you can use to write out trace messages:

  • TraceError,
  • TraceInformation,
  • TraceWarning.

The messages you create using these methods are sent to objects called listeners. During debug, a DefaultTraceListener displays any trace messages you have written into the Visual Studio output window. Other listeners that you can use include the EventLogTraceListener and TextWriterTraceListener. These listeners are used to write trace messages into the Windows event log or a text file. The trace.axd handler allows you to view trace messages through a web page, and we’ll explain how to view this later on.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial