-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DebuggerTypeProxy types are empty after linking #37307
Comments
I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label. |
That sounds reasonable; while technically the debugger can show things beyond public properties, every type proxy I've looked at has only public constructors and properties (beyond the private fields that serve those properties). That said, the same argument could be used to say "just keep everything", because there's unlikely to be anything more in the debugger type proxy than public ctors and properties, and if there is, it's likely there for a good debugging reason. |
That's odd because linker has bunch of code that is attempting to do stuff with that attribute. I'll be happy to replace this with the public dataflow annotations and delete the linker special casing with prejudice. Unless we get a statement from VS debugging folks on what they can actually use, I would go with |
It looks like in order to get that code activated, you need to pass We should probably come up with a coherent strategy for trimming "debug only" code out. I think we should have a single "feature switch" that can be turned on/off as necessary. See |
Also, ensure the test app assembly is linked, and not copied during trimming tests, which was a bug in our test infrastructure. Fix dotnet#37307
* Preserve DebuggerTypeProxyAttribute classes Also, ensure the test app assembly is linked, and not copied during trimming tests, which was a bug in our test infrastructure. Fix #37307 * Add test for DebuggerTypeProxy string overload. * Update ref to match impl.
After linking an application, any type that is used by a
DebuggerTypeProxyAttribute
still exists, but is empty. This is because there are no callers of any of the members on these types - they exist so the debugger can call them to show in the Watch window. So the linker is removing all of the members from the type. But the type remains because it is being referenced by theDebuggerTypeProxyAttribute
. This will limit the ability to debug a linked application, because any type that uses a DebuggerTypeProxy will be empty in the Watch window.We should fix this by annotating the DebuggerTypeProxyAttribute class to tell the linker to preserve its members that are required by the debugger. My initial thinking is that includes
PublicConstructors
andPublicProperties
, as I don't think the debugger will call any methods on the proxy type.cc @vitek-karas @joperezr @layomia
The text was updated successfully, but these errors were encountered: