469,909 Members | 1,737 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

hides inherited member ApplicationInstance

VS2005 RTM

Create a web user control to use as a base class for other web user
controls.
Now, create a new web user control, change the class it inherits from to
your base class and compile.
(You must have a <% Register %> so it will see it)

You will get TWO warnings per class like:

Warning 4 'YourUserControl.ApplicationInstance' hides inherited member
'BaseUserControl.ApplicationInstance'. Use the new keyword if hiding was
intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0 .cs 29

Warning 3 'YourUserControl.Profile' hides inherited member
'BaseUserControl.Profile'. Use the new keyword if hiding was intended.
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0 .cs 23
Problem is the inherited member it is hiding was code generated by the base
class, and the code generated for the inheriting class automatically by
Visual Studio.

This warning does not seem to cause any issues, but would like to get rid of
it, because when I deploy I have to sift through them all.

Any help, future fixes? Should I file as a bug?
Dec 15 '05 #1
3 5256
Hi Wayne,

Welcome to ASPNET newsgroup.
Regarding on the warning problem you mentioned, I did notice it in some
other scenario. Actually this is a expected behavior due to the new ASP.NET
page/usercontrol's partial class model. All the codebehind defines a
partial class so that the actual compiled class will contains other dynamic
generated properties...
Currently our suggestion will be move those common base page classes or
usercontrol base classes into a single alone class file (e.g put in the
App_Code dir ... ) rather than use existing page or usercontrol's
codebehind(partial class....)

Also, I think you can post this request through the MSDN feedback center:

http://lab.msdn.microsoft.com/produc...k/default.aspx

but it may need sometime for the dev guys to reconsider it since that'll
cause change to the underlying page structure and compilation model....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Wayne Brantley" <Wa***********@noemail.nospam>
| Subject: hides inherited member ApplicationInstance
| Date: Thu, 15 Dec 2005 17:06:45 -0500
| Lines: 31
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <OH*************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: pcp01076601pcs.midval01.tn.comcast.net 68.59.220.208
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:365214
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| VS2005 RTM
|
| Create a web user control to use as a base class for other web user
| controls.
| Now, create a new web user control, change the class it inherits from to
| your base class and compile.
| (You must have a <% Register %> so it will see it)
|
| You will get TWO warnings per class like:
|
| Warning 4 'YourUserControl.ApplicationInstance' hides inherited member
| 'BaseUserControl.ApplicationInstance'. Use the new keyword if hiding was
| intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
| Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0 .cs 29
|
| Warning 3 'YourUserControl.Profile' hides inherited member
| 'BaseUserControl.Profile'. Use the new keyword if hiding was intended.
| c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
| Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0 .cs 23
|
|
| Problem is the inherited member it is hiding was code generated by the
base
| class, and the code generated for the inheriting class automatically by
| Visual Studio.
|
| This warning does not seem to cause any issues, but would like to get rid
of
| it, because when I deploy I have to sift through them all.
|
| Any help, future fixes? Should I file as a bug?
|
|
|

Dec 16 '05 #2
Steven,
Partial class - yep, that is the exact problem. However, let me be
clear on what you are saying.

I have an .ascx file with NOTHING in it but the control tag.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BaseEdit.ascx.cs"
Inherits="Common_BaseEdit" %>

I then have code behind that inherits from
System.Web.UI.UserControl

That causes some code behind to be generated.

You are saying, I can just throw away the .ascx file (which stops the code
from being generated) and have the classes inherit from my base class
anyway? If this is true, the generated code is USELESS, even though I have
looked at it and it generates some constructors, calls to base class
methods, etc. Further if that is true, then it would be a SIMPLE change
for your dev guys, because if an ascx file is empty (only contains the
control tag) NO code generation is necessary!!!!! - (the ascx file cannot
contain any controls for base web user controls anyway, so that is always
the case)

If that is what you are saying, then I can certainly do that to stop these
warning methods (or better yet, I will move that file to an existing
supporting class project library).
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:4z**************@TK2MSFTNGXA02.phx.gbl...
Hi Wayne,

Welcome to ASPNET newsgroup.
Regarding on the warning problem you mentioned, I did notice it in some
other scenario. Actually this is a expected behavior due to the new
ASP.NET
page/usercontrol's partial class model. All the codebehind defines a
partial class so that the actual compiled class will contains other
dynamic
generated properties...
Currently our suggestion will be move those common base page classes or
usercontrol base classes into a single alone class file (e.g put in the
App_Code dir ... ) rather than use existing page or usercontrol's
codebehind(partial class....)

Also, I think you can post this request through the MSDN feedback center:

http://lab.msdn.microsoft.com/produc...k/default.aspx

but it may need sometime for the dev guys to reconsider it since that'll
cause change to the underlying page structure and compilation model....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Wayne Brantley" <Wa***********@noemail.nospam>
| Subject: hides inherited member ApplicationInstance
| Date: Thu, 15 Dec 2005 17:06:45 -0500
| Lines: 31
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <OH*************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: pcp01076601pcs.midval01.tn.comcast.net 68.59.220.208
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:365214
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| VS2005 RTM
|
| Create a web user control to use as a base class for other web user
| controls.
| Now, create a new web user control, change the class it inherits from to
| your base class and compile.
| (You must have a <% Register %> so it will see it)
|
| You will get TWO warnings per class like:
|
| Warning 4 'YourUserControl.ApplicationInstance' hides inherited member
| 'BaseUserControl.ApplicationInstance'. Use the new keyword if hiding was
| intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary
ASP.NET
| Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0 .cs 29
|
| Warning 3 'YourUserControl.Profile' hides inherited member
| 'BaseUserControl.Profile'. Use the new keyword if hiding was intended.
| c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
| Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0 .cs 23
|
|
| Problem is the inherited member it is hiding was code generated by the
base
| class, and the code generated for the inheriting class automatically by
| Visual Studio.
|
| This warning does not seem to cause any issues, but would like to get
rid
of
| it, because when I deploy I have to sift through them all.
|
| Any help, future fixes? Should I file as a bug?
|
|
|

Dec 16 '05 #3
Thanks for your response Wayne,

Sorry if I haven't made things clear, for the following:

=====================================
You are saying, I can just throw away the .ascx file (which stops the code
from being generated) and have the classes inherit from my base class
anyway? If this is true, the generated code is USELESS, even though I have
looked at it and it generates some constructors, calls to base class
methods, etc
======================================
Actually, what I want to mean is defining a separate base UserControl
class(derived from Usercontrol) and there is no ascx file associated with
it, in other words, it is just as a normal component class in the App_Code
folder.... Then, our other concrete ascx usercontrol's codebehind
UserControl class will derive from that class..... So to avoid those
warning(some autogenerated properteis being hidden), we have to avoid make
our ascx usercontrol's codebehind class derived from another ascx
usercontrol's codebehind class( being autocompiled through partial
class....)....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Wayne Brantley" <Wa***********@noemail.nospam>
| References: <OH*************@TK2MSFTNGP12.phx.gbl>
<4z**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: hides inherited member ApplicationInstance
| Date: Fri, 16 Dec 2005 10:03:23 -0500
| Lines: 120
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <uv*************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: pcp01076601pcs.midval01.tn.comcast.net 68.59.220.208
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:365323
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Steven,
| Partial class - yep, that is the exact problem. However, let me be
| clear on what you are saying.
|
| I have an .ascx file with NOTHING in it but the control tag.
| <%@ Control Language="C#" AutoEventWireup="true"
CodeFile="BaseEdit.ascx.cs"
| Inherits="Common_BaseEdit" %>
|
| I then have code behind that inherits from
| System.Web.UI.UserControl
|
| That causes some code behind to be generated.
|
| You are saying, I can just throw away the .ascx file (which stops the
code
| from being generated) and have the classes inherit from my base class
| anyway? If this is true, the generated code is USELESS, even though I
have
| looked at it and it generates some constructors, calls to base class
| methods, etc. Further if that is true, then it would be a SIMPLE change
| for your dev guys, because if an ascx file is empty (only contains the
| control tag) NO code generation is necessary!!!!! - (the ascx file
cannot
| contain any controls for base web user controls anyway, so that is always
| the case)
|
| If that is what you are saying, then I can certainly do that to stop
these
| warning methods (or better yet, I will move that file to an existing
| supporting class project library).
|
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:4z**************@TK2MSFTNGXA02.phx.gbl...
| > Hi Wayne,
| >
| > Welcome to ASPNET newsgroup.
| > Regarding on the warning problem you mentioned, I did notice it in some
| > other scenario. Actually this is a expected behavior due to the new
| > ASP.NET
| > page/usercontrol's partial class model. All the codebehind defines a
| > partial class so that the actual compiled class will contains other
| > dynamic
| > generated properties...
| > Currently our suggestion will be move those common base page classes or
| > usercontrol base classes into a single alone class file (e.g put in the
| > App_Code dir ... ) rather than use existing page or usercontrol's
| > codebehind(partial class....)
| >
| > Also, I think you can post this request through the MSDN feedback
center:
| >
| > http://lab.msdn.microsoft.com/produc...k/default.aspx
| >
| > but it may need sometime for the dev guys to reconsider it since that'll
| > cause change to the underlying page structure and compilation model....
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| > --------------------
| > | From: "Wayne Brantley" <Wa***********@noemail.nospam>
| > | Subject: hides inherited member ApplicationInstance
| > | Date: Thu, 15 Dec 2005 17:06:45 -0500
| > | Lines: 31
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | Message-ID: <OH*************@TK2MSFTNGP12.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: pcp01076601pcs.midval01.tn.comcast.net
68.59.220.208
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:365214
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | VS2005 RTM
| > |
| > | Create a web user control to use as a base class for other web user
| > | controls.
| > | Now, create a new web user control, change the class it inherits from
to
| > | your base class and compile.
| > | (You must have a <% Register %> so it will see it)
| > |
| > | You will get TWO warnings per class like:
| > |
| > | Warning 4 'YourUserControl.ApplicationInstance' hides inherited member
| > | 'BaseUserControl.ApplicationInstance'. Use the new keyword if hiding
was
| > | intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary
| > ASP.NET
| > | Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0 .cs 29
| > |
| > | Warning 3 'YourUserControl.Profile' hides inherited member
| > | 'BaseUserControl.Profile'. Use the new keyword if hiding was intended.
| > | c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
| > | Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0 .cs 23
| > |
| > |
| > | Problem is the inherited member it is hiding was code generated by the
| > base
| > | class, and the code generated for the inheriting class automatically
by
| > | Visual Studio.
| > |
| > | This warning does not seem to cause any issues, but would like to get
| > rid
| > of
| > | it, because when I deploy I have to sift through them all.
| > |
| > | Any help, future fixes? Should I file as a bug?
| > |
| > |
| > |
| >
|
|
|

Dec 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by ashok | last post: by
2 posts views Thread by Mark Olbert | last post: by
4 posts views Thread by Sebastian Böck | last post: by
14 posts views Thread by lovecreatesbea... | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.