Red Gate forums :: View topic - Invalid object initializer generated in C# and VB.NET
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
.NET Reflector 7 EAP
.NET Reflector 7 EAP forum

Invalid object initializer generated in C# and VB.NET

Search in .NET Reflector 7 EAP forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
evgeny



Joined: 20 Feb 2011
Posts: 5

PostPosted: Mon Feb 21, 2011 12:20 am    Post subject: Invalid object initializer generated in C# and VB.NET Reply with quote

When decompiling WaIISHost.exe from Windows Azure SDK 1.3 Reflector 7 beta 3 and beta 4 both generate the following code:

Code:
 
           setup = new AppDomainSetup {
                ApplicationName = "RoleManager",
                ApplicationBase = directoryName,
                PrivateBinPath = setup.ApplicationBase
            };


This fails to compile:

Quote:
error CS0165: Use of unassigned local variable 'setup'


The code should not use an object initializer in this case:

Code:

            setup = new AppDomainSetup();
            setup.ApplicationName = "RoleManager";
            setup.ApplicationBase = directoryName;
            setup.PrivateBinPath = setup.ApplicationBase;
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group