简体   繁体   中英

disable DebuggerStepThrough for partial class

I have set of classes that are auto generated by tool. but all classes are marked with DebuggerStepThrough attribute

the classes are partial, so I can write my code for that class in separate file, however DebuggerStepThrough in auto generated part of partial class will affect entire class.

How can I disable this behavior for DebuggerStepThrough , removing DebuggerStepThrough is obvious solution but that's not the answer I'm looking for. I don't want to touch auto generated code. also skipping from auto generated code is ok, but I want to be able to debug my own code.

[DebuggerStepThrough]
partial class Foo
{
   // auto generated
}

// how to exclude this part from DebuggerStepThrough?
partial class Foo
{
   // user code
}

What you are asking to do is impossible as far as I know. Partial class attributes are merged at compile time. So your two partial classes:

[DebuggerStepThrough]
partial class Foo
{
    // auto generated
}

partial class Foo
{
    // user code
}

Compile to this:

[DebuggerStepThrough]
class Foo
{
    // auto generated

    // user code
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM