"The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)"
RSS
I can report that changing to CodeBehind did indeed solve the issue. (also reporting that I had the issue) Doesn't make much sense tho since i have another page that works just fine with the CodeFile attribute.
The controls are nearly identical (created by a generator).
Jeff Martin
MCSD C# .NET
http://www.jeffmartin.com
So this happens every time i regenerate my code, (using .NetTiers and codesmith).
(I'm leaving it codefile instead of codebehind as I believe codefile is supposed to be the preferred syntax).
to let you know my configuration:
I'm using the webadmin controls generated by .NetTiers in a Web Application Project. The error occurs when I run it on my local machine.
The page that it occurs on is using a very simple master page and really the only thing on the page is the content control with the NetTiers UC in it.
As I mentioned before, it doesn't happen on all the user controls generated by NetTiers, but I can't find a difference that would do this between the control that works and the one that needs to be altered to work.
Jeff Martin
MCSD C# .NET
http://www.jeffmartin.com
try to create a new usercontrol in vs.net 2005. It will create as CodeBehind not as CodeFile. I guess CodeBehind is the suitable property in the vs.net 2005.
CodeFile willl work with converted .net projects(vs.net 2003 to vs.net 2005). But when you try to add new web form to converted project and try to use an user control of vs.net 2003 version, this error occurs.
You should be able to do this scenario just fine. If you are just using the control on a page, then you should be able to just use a <%@ Register %> directive (no refrence directive required).
Can you send me via email (scottgu@microsoft.com) a simple project that shows this problem? I can then help debug it more and figure out what is going on.
Thanks,
Scott
I take it you were unable to repro this using the project that Ray emailed to you (that you requested)? I'm having a similiar issue and would like to hear from you on this :)
===========================
Check out my SQL Server and .NET training videos at http://www.learnitfirst.com/
I had the same problem. I had to move the control that I created into the folder of the page that I was putting it on in order for it not to give me the following error:
The base class includes the field 'MainToolbarMenu1', but its type (Web.Common.UserControls.MainToolbarMenu) is not compatible with the type of control (ASP.web_common_usercontrols_maintoolbarmenu_ascx).
I was having the same issue and ran across this thread. This was only happening to me when I did a precompiled site. I noticed in the compiled ASCX file, it said
<%@ control language="C#" autoeventwireup="true" inherits="ApplicationContactTypeCheckBoxList, App_Web_dbsj1fkk" %>
However, in my bin folder, there was a file called App_Web_applicationcontacttypecheckboxlist.ascx.77ebd44d.dll
When I changed the inherits to inherits="ApplicationContactTypeCheckBoxList, App_Web_applicationcontacttypecheckboxlist.ascx.77ebd44d" the problem went away. Seems to me that Visual Studio is putting the wrong type in the inherits property, or it's compiling
that user control into a different assembly for some reason. All of the other user controls in that folder are inheriting from "App_Web_dbsj1fkk".
Then out of curiosity, I took a look at both DLLs in the object browser.
That user control is compiled into both DLLs. There's more going on here than I fully understand, but I have a useable workaround for now.
I kept getting this problem when updating usercontrols and the binary but it seemed to happen once I added .net 2.0 to the server.
As it is an intermittent problem, I have found it impossible to recreate. I do, however, have a solution of sorts.
If you dont have admin access to the IIS server involved you're not going to be able to use this solution.
As soon as you get the "base class usercontrol error", get access to the IIS server where the site is hosted.
1) Open the properties for the offending site.
2) Select the Home Directory tab
3) Under Application Settings, click Remove
4) Create a new Application using the same button
That should sort out all the bad class references.
"base class error" asp.net error bug uploading development
#####################
ASP.NET C#
FLASH Actionscript 2.0/3.0
XNA programmer
#####################
Neil Highley
http://neilhighley.com
Maduka
Member
10 Points
2 Posts
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Jun 05, 2006 10:26 AM|LINK
Hi Guys
I think i found the solution........
Just change the CodeFile attribute in Usercontrol html in to CodeBehind ....it will work...
In asp.net 2003 usercountrol html u get the folowing declaration..
<%@ Control Language="c#" AutoEventWireup="true" Inherits="xxxxxxxxxxx" CodeFile="xxxxxxxxxxxxxxxxs" %>
In asp.net 2005
<%@ Control Language="c#" AutoEventWireup="true" Inherits="xxxxxxxxxx" CodeBehind="xxxxxxxxxxxxxx" %>
Rgds
Maduka
jjmartin
Participant
993 Points
204 Posts
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Jun 08, 2006 08:27 PM|LINK
I can report that changing to CodeBehind did indeed solve the issue. (also reporting that I had the issue) Doesn't make much sense tho since i have another page that works just fine with the CodeFile attribute.
The controls are nearly identical (created by a generator).
MCSD C# .NET
http://www.jeffmartin.com
jjmartin
Participant
993 Points
204 Posts
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Jun 08, 2006 11:00 PM|LINK
So this happens every time i regenerate my code, (using .NetTiers and codesmith).
(I'm leaving it codefile instead of codebehind as I believe codefile is supposed to be the preferred syntax).
to let you know my configuration:
I'm using the webadmin controls generated by .NetTiers in a Web Application Project. The error occurs when I run it on my local machine.
The page that it occurs on is using a very simple master page and really the only thing on the page is the content control with the NetTiers UC in it.
As I mentioned before, it doesn't happen on all the user controls generated by NetTiers, but I can't find a difference that would do this between the control that works and the one that needs to be altered to work.
MCSD C# .NET
http://www.jeffmartin.com
Maduka
Member
10 Points
2 Posts
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Jun 09, 2006 05:05 AM|LINK
Hi
try to create a new usercontrol in vs.net 2005. It will create as CodeBehind not as CodeFile. I guess CodeBehind is the suitable property in the vs.net 2005.
CodeFile willl work with converted .net projects(vs.net 2003 to vs.net 2005). But when you try to add new web form to converted project and try to use an user control of vs.net 2003 version, this error occurs.
Rgds
Maduka
bigtoga
Member
465 Points
93 Posts
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Jul 21, 2006 01:28 AM|LINK
Check out my SQL Server and .NET training videos at http://www.learnitfirst.com/
mike.cao
Member
70 Points
15 Posts
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Jul 22, 2006 12:37 PM|LINK
ZMAN11
Member
15 Points
3 Posts
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Nov 25, 2006 05:28 AM|LINK
I had the same problem. I had to move the control that I created into the folder of the page that I was putting it on in order for it not to give me the following error:
Check out this link: http://support.microsoft.com/kb/919284PeteNelson
Member
5 Points
1 Post
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Dec 07, 2006 09:24 PM|LINK
I was having the same issue and ran across this thread. This was only happening to me when I did a precompiled site. I noticed in the compiled ASCX file, it said
<%@ control language="C#" autoeventwireup="true" inherits="ApplicationContactTypeCheckBoxList, App_Web_dbsj1fkk" %>
However, in my bin folder, there was a file called App_Web_applicationcontacttypecheckboxlist.ascx.77ebd44d.dll
When I changed the inherits to inherits="ApplicationContactTypeCheckBoxList, App_Web_applicationcontacttypecheckboxlist.ascx.77ebd44d" the problem went away. Seems to me that Visual Studio is putting the wrong type in the inherits property, or it's compiling that user control into a different assembly for some reason. All of the other user controls in that folder are inheriting from "App_Web_dbsj1fkk".
Then out of curiosity, I took a look at both DLLs in the object browser.
That user control is compiled into both DLLs. There's more going on here than I fully understand, but I have a useable workaround for now.
neilhighey
Member
2 Points
1 Post
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Jan 01, 2007 10:16 AM|LINK
I kept getting this problem when updating usercontrols and the binary but it seemed to happen once I added .net 2.0 to the server.
As it is an intermittent problem, I have found it impossible to recreate. I do, however, have a solution of sorts.
If you dont have admin access to the IIS server involved you're not going to be able to use this solution.
As soon as you get the "base class usercontrol error", get access to the IIS server where the site is hosted.
1) Open the properties for the offending site.
2) Select the Home Directory tab
3) Under Application Settings, click Remove
4) Create a new Application using the same button
That should sort out all the bad class references.
"base class error" asp.net error bug uploading development
ASP.NET C#
FLASH Actionscript 2.0/3.0
XNA programmer
#####################
Neil Highley
http://neilhighley.com
highpointble...
Member
2 Points
4 Posts
Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is...
Jan 24, 2007 03:13 PM|LINK
All,
Here is something...
I use a control called "Address". It is a simple address entry form. Use it in a couple of places.
On my dev platform...
I debug my code and on page "A" works, the other, page "B" gets the "base class usercontrol error".
When the site is on production...
Page "A" doesn't work, and the page "B" does.
The rest of the code is the same. Is it an IIS config issue?
I am beating my head against the wall.
HPB