Run a .NET obfuscator over a library and open the result in a decompiler. Types collapse to a, b, c; methods become single letters; fields are unreadable. Then you hit a method that returns a tuple, and the decompiler calmly prints (decimal balance, int openTrades, DateTime asOf) — every business-meaningful name intact, on a method now called a.b(). The renamer did its job on every identifier it could see. It never touched those names, because they were never identifiers.

The real question

Named tuples feel like they have members. You write result.balance and it compiles. So where does balance live, and why does a tool that rewrites every type, method, field and parameter name leave it alone?

The answer is that a named tuple has no runtime existence as a named thing at all. (decimal balance, int openTrades) is just System.ValueTuple<decimal, int>. Its only storage is the public fields Item1 and Item2. The names you wrote are a compile-time fiction, and the compiler has to smuggle them across the assembly boundary somehow so that your consumers' compiler can also offer .balance. It does that with a custom attribute — and a custom attribute's string payload is exactly the kind of data a renamer is built not to rewrite.

The mechanism, shown

Start with an ordinary method on a public type:

public (decimal balance, int openTrades) GetSummary() => (_balance, _trades.Count); 

The C# compiler lowers this to a method returning ValueTuple<decimal, int> and attaches the element names to the return value as a TupleElementNamesAttribute. In ILDASM you see it on .param [0] (the return slot):

.method public hidebysig instance valuetype [System.Runtime]System.ValueTuple`2<valuetype [System.Runtime]System.Decimal, int32> GetSummary() cil managed { .param [0] .custom instance void [System.Runtime]System.Runtime.CompilerServices .TupleElementNamesAttribute::.ctor(string[]) = ( 01 00 02 00 00 00 07 62 61 6C 61 6E 63 65 // .....balance 0A 6F 70 65 6E 54 72 61 64 65 73 00 00 ) // .openTrades.. // body elided } 

Read the blob. 01 00 is the custom-attribute prolog. 02 00 00 00 is the array length — two strings. Then each string is length-prefixed UTF-8: 07 then balance, 0A then openTrades. The names are sitting in the #Blob heap as literal text, parented to the return parameter.

That is the whole leak. The fields Item1 and Item2 are real runtime storage and belong to System.ValueTuple, a BCL type a renamer will not touch. The names are a decoration on the signature, and the renamer's contract is to rewrite metadata identifiers — rows in the TypeDef, MethodDef, Field, Param and Property tables, plus the #Strings heap they point into. A TupleElementNamesAttribute argument is none of those. It is an opaque byte array in #Blob. The rename pass walks the token graph, renumbers and renames the identifiers, and steps straight over the attribute's payload because rewriting arbitrary attribute blobs is exactly the behaviour that corrupts serialization contracts, DI scans and config binding. So it leaves it — and your names ride along untouched.

A named tuple splits into runtime fields (renamer-safe) and a metadata attribute that carries the readable names straight through obfuscation.

The result after a names-only pass is an assembly whose decompiled public surface still reads like documentation:

// decompiled from the "obfuscated" build public (decimal balance, int openTrades) a() { /* ... */ } 

The method is a. The intent is not.

Where the attribute appears, and where it does not

The attribute is emitted anywhere a named tuple forms part of a signature: method return values, parameters, fields, and property types. It is not emitted for local variables — local tuple names are a purely lexical convenience and are discarded, so a var x = (lo: 1, hi: 2); inside a method body leaves nothing in metadata to leak.

Nesting and generics flatten into one array with null placeholders. (int a, (int b, int c) d) becomes the transform array { "a", "d", "b", "c" } — outer elements first, then the nested ones in order. A tuple inside another generic, like List<(int x, int y)>, emits { null, "x", "y" }, where the leading null is the non-tuple List<> position. Any correct stripping pass has to understand this layout rather than blindly deleting the attribute, because the same attribute can decorate a position that mixes tuple and non-tuple slots.

This is the same class of leak as DynamicAttribute (which records where dynamic was erased to object) and NativeIntegerAttribute: all three are transform decorations the compiler reads back to reconstruct source-level types. Tuple names are the one that leaks business vocabulary.

How Nebula handles it

Nebula treats TupleElementNamesAttribute as part of the rename problem, not a bystander. On any member that is not externally reachable — private and internal signatures, and the whole assembly when nothing references it — the names are dead weight: nothing at runtime reads them, and no outside compiler can see the member to bind .balance against it. Those attributes are removed, respecting the nesting layout above so a { null, "x", "y" } blob is dropped as a unit rather than corrupted.

On your public API, stripping is a source-compatibility decision, not a correctness one. A consumer compiling against the library reads these names to offer .balance; strip them and that consumer falls back to .Item1 and .Item2. For a shipped SDK that is a breaking change to the authored experience, so Nebula keeps public-signature tuple names by default and lets you opt in per the keep-list:

<Nebula> <!-- drop tuple element names from non-public signatures (default) --> <StripTupleElementNames>true</StripTupleElementNames> <!-- also drop them from the public surface — breaks named access for consumers --> <StripPublicTupleElementNames>false</StripPublicTupleElementNames> </Nebula> 

If the tuple is leaking real vocabulary from a public method and you do not need consumers to see the names — an app rather than a library, or an internal boundary you expose as public only for a plugin host — flip the second flag, or better, change the return type to a named readonly record struct that the renamer can rewrite end to end. A record's property names are identifiers; tuple element names are not, and that is the whole difference.

Caveats

Removing the attribute changes nothing a user observes at runtime and nothing reflection sees over the tuple — Item1, Item2, Tuple.Create, pattern matching and deconstruction all work unchanged, because they never depended on the names. The only observable effect is on source that references the member at compile time, and only for public surfaces. Do not reach for this as a security control either: hiding the word balance raises the cost of reading your design, it does not protect the value behind it. Pair it with string and constant encryption for the data that matters.

Takeaway

Obfuscation renames identifiers, and tuple element names are not identifiers — they are a string blob the compiler smuggles across the assembly boundary so your callers can write .balance. Left alone, that blob narrates your public design to anyone with a decompiler. Strip it where nothing can reference it, decide deliberately where something can, and promote the tuples that carry real vocabulary to records so every name is something the renamer owns. See the Nebula product page and the obfuscation docs for the full keep-list model.