Unexpected character $ in generated C# file

Explore, browse and analyze .NET assemblies

Moderators: Luke Jefferson, Clive Tong, nick.maidment

Unexpected character $ in generated C# file

Postby evgeny » Mon Feb 21, 2011 12:14 am

When decompiling WaIISHost.exe from Windows Azure SDK 1.3 Reflector 7 beta 4 generates code like this:


Code: Select all
                string CS$0$0001;
                this.RoleInstanceID = CS$0$0001 = Environment.GetEnvironmentVariable("RdRoleId");
                if (CS$0$0001 == null)


The C# compiler in VS 2010 errors on this:

WaIISHost\\Parameters.cs(31,26): error CS1056: Unexpected character '$'


This did not happen in beta 3.
evgeny
 
Posts: 5
Joined: Sun Feb 20, 2011 11:07 pm

Postby evgeny » Mon Feb 21, 2011 12:17 am

There is other invalid code as well:

Code: Select all
ConsoleTraceListener <>g__initLocal0 = new ConsoleTraceListener(false) {


This also didn't happen in beta 3.
evgeny
 
Posts: 5
Joined: Sun Feb 20, 2011 11:07 pm

Postby alehandro » Mon Feb 21, 2011 11:42 pm

from my experience,
string CS$0$0001; - that is a valid compiler generated string!
but when you try to do compile it as a user code -bang, then $ is forbidden, yes

the only way is to do manual replace of $ into X for example :)
alehandro
 
Posts: 35
Joined: Tue Nov 16, 2010 12:08 am


Return to .NET Reflector 7 EAP

Who is online

Users browsing this forum: No registered users and 0 guests