I'm attempting to upgrade a web site originally developed in 1.1 that has been migrated to 2.0 & 3.5 over the years, up to 4.0. Currently, I only have access to Visual Web Developer 2010 Express, & have been copying old files into a new solution bit by
bit & squashing the bugs as they come up. There are a couple warnings that confuse me:
<derived control>.Profile hides inherited member <base control>.Profile. Use the new keyword if hiding was intended. ..\781f76f0\ece8b0f2\App_Web_q1ixf3o4.0.cs
<derived control>.ApplicationInstance hides inherited member <base control>.ApplicationInstance. Use the new keyword if hiding was intended. ..\781f76f0\ece8b0f2\App_Web_q1ixf3o4.0.cs
Here's the interesting part: the base control doesn't have the members Profile or ApplicationInstance. The base control derives from System.Web.UI.UserControl. Has that class changed in some way in 4.0 to have these members? & why do the warnings come
from the pre-compiled file, but not the code behind file?
Due to the problem,I think it's because you've had a function whose name with its parameters the same as what it is inherits from its father(base class)……,So this will cause the problem。See this sample below(this will raise the error)
namespaceA { classFather { publicvoidA() {
} }
classB:Father { publicvoidA() //you must exclipitly use public new…… to override this kind of problem {
Yeah, I get the inheritance. The prob is that neither the base nor derived classes have Profile & ApplicationInstance as members. The only idea I have is that the .net UserControl class that the base class derives from has changed to include these members &
require them to be overridden (which I believe means they would have to be marked as "abstract"?). I'm not certain if this I the case, but without changing the code when upgrading to .net 4, these warnings now appear. - O8
the code base is quite large, & it doesn't look like I can attach files... is there something in particular you are looking for? perhaps I can make a new simplified version that generates the same issue & copy that in?
the code base is quite large, & it doesn't look like I can attach files... is there something in particular you are looking for? perhaps I can make a new simplified version that generates the same issue & copy that in?
Hello again:)
I just want to see your current codes to make sure whether it's the code problem……Just like the sample I've offered to you to reproduce the problem issue……。Make sure that if there's an abstract function in your father's class,you must use "override" instead
of using "new"。
RealityMasqu...
Member
23 Points
18 Posts
Inherited Member being hidden
Jan 17, 2012 09:13 AM|LINK
Heya,
I'm attempting to upgrade a web site originally developed in 1.1 that has been migrated to 2.0 & 3.5 over the years, up to 4.0. Currently, I only have access to Visual Web Developer 2010 Express, & have been copying old files into a new solution bit by bit & squashing the bugs as they come up. There are a couple warnings that confuse me:
Here's the interesting part: the base control doesn't have the members Profile or ApplicationInstance. The base control derives from System.Web.UI.UserControl. Has that class changed in some way in 4.0 to have these members? & why do the warnings come from the pre-compiled file, but not the code behind file?
Basically, how do I squash these warnings?
- O8
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Inherited Member being hidden
Jan 19, 2012 12:20 AM|LINK
Hello:)
Due to the problem,I think it's because you've had a function whose name with its parameters the same as what it is inherits from its father(base class)……,So this will cause the problem。See this sample below(this will raise the error)
RealityMasqu...
Member
23 Points
18 Posts
Re: Inherited Member being hidden
Jan 19, 2012 07:39 AM|LINK
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Inherited Member being hidden
Jan 20, 2012 11:08 AM|LINK
Hello again:)
Would you mind showing us your codes so as to let me check it?
Reguards!
RealityMasqu...
Member
23 Points
18 Posts
Re: Inherited Member being hidden
Jan 20, 2012 11:14 AM|LINK
the code base is quite large, & it doesn't look like I can attach files... is there something in particular you are looking for? perhaps I can make a new simplified version that generates the same issue & copy that in?
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Inherited Member being hidden
Jan 21, 2012 08:14 AM|LINK
Hello again:)
I just want to see your current codes to make sure whether it's the code problem……Just like the sample I've offered to you to reproduce the problem issue……。Make sure that if there's an abstract function in your father's class,you must use "override" instead of using "new"。