NTrace doesn't work with partial classes

May 15, 2011 at 9:44 AM

Hi,

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?

Thanks,

--Eran

Coordinator
May 15, 2011 at 1: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 1:47 PM

That's what I did. Thanks.

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