Question

For all the examples I have seen of people creating a TraceSource for a class, it is always defined as static

private static TraceSource traceSource = new TraceSource("TraceSourceApp");

Why do this over

private readonly TraceSource _traceSource = new TraceSource("TraceSourceApp");

What's the advantages/disadvantages?

Was it helpful?

Solution

They should always be static.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top