How can we help you today? How can we help you today?

Invalid object initializer generated in C# and VB.NET

When decompiling WaIISHost.exe from Windows Azure SDK 1.3 Reflector 7 beta 3 and beta 4 both generate the following code:
           setup = new AppDomainSetup {
                ApplicationName = "RoleManager",
                ApplicationBase = directoryName,
                PrivateBinPath = setup.ApplicationBase
            };

This fails to compile:
error CS0165: Use of unassigned local variable 'setup'

The code should not use an object initializer in this case:
            setup = new AppDomainSetup();
            setup.ApplicationName = "RoleManager";
            setup.ApplicationBase = directoryName;
            setup.PrivateBinPath = setup.ApplicationBase;
evgeny
0

Add comment

Please sign in to leave a comment.