NTrace doesn't work with partial classes

May 15, 2011 at 10:44 AM


When partial class is used, NTrace proprocessor generates _etwMessageGuid for each instance of the class, and as a results the compiler yields the following error (I've defined program as partial):

c:\Temp\NTraceTest\Program.cs(17,33): error CS0102: The type 'NTraceTest.Program' already contains a definition for '_etwMessageGuid'

Is this a known issue? Is there a workaround?



May 15, 2011 at 2:45 PM

Yep, that has been a known issue since 1.0, but I hadn't taken the time to fix it. I'll bake a fix into the next drop. In the meantime, the (ugly, awful and shameful) workaround is to limit your tracing to one of the files in a partial class.

May 15, 2011 at 2:47 PM

That's what I did. Thanks.

Please LMK when the fix is available and I'll test it.