Eric J.
Eric J.

Reputation: 150228

Understanding C# strings reconstructed by Reflector

I have been asked to help with a C# project where the source code is no longer available. Fortunately a non-obfuscated debug build of the project is available, so I ran it through Reflector and the reconstructed source code looks largely fine.

There is one oddity that I have a question about. Some objects that pretty clearly should be a string are coming out like this:

string str7 = new string();
str7.Value = strArray3[k];

Now, string does not have a parameterless constructor nor does it have a Value property. I think I can just remove the instantiation and remove the .Value property and things will probably work as expected, but I would like to understand if there might be something more going on than a Reflector bug.

One other interesting piece is that almost all of the variables were reconstructed with original-sounding names, but this one (and a few others) seem to have been assigned random names.

Any insight is very welcome.

Upvotes: 2

Views: 345

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283921

Can you post both the IL and decompiled C# for the same method where this happens?

There isn't by chance a "class string { ... }" in that assembly, is there?

Upvotes: 1

Related Questions