2
Vote

Dont work in Visual Studio 2008

description

public SectionContainer Parent
    {
        get
        {
            return _parent;
        }
        protected set
        {
            _parent = value;
        }
    }
 
i have to remove the protected so that it works!

file attachments

comments

Superstar wrote Dec 19, 2007 at 12:14 AM

Do you mean that it doesn't work in all versions of the dot net framework within Visual Studio 2008, or the dot net framework 3.5 only?

daz_007 wrote Jan 8, 2008 at 11:15 AM

Its a little odd how this worked in VS2005. Although SectionContainer derives from Section, it does not use the derived Section.Parent property, i.e. this.Parent, instead SectionContainer uses separate Section instances and uses the property on those instances. Therefore this instance should not be able to access a protected property. The solution is to make the Parent set property internal.

miller wrote Jul 12, 2008 at 8:12 AM

you may change

protected set
{
_parent = value;
}

to

internal protected set
{
_parent = value;
}

wrote Nov 25, 2008 at 1:23 PM

twain wrote Nov 25, 2008 at 2:06 PM

The patch file to fix this problem is included as attachment.

wrote Nov 25, 2008 at 2:06 PM

wrote Feb 14, 2013 at 2:28 AM