"The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)"http://forums.asp.net/t/960707.aspx/1?+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Fri, 11 Dec 2009 11:57:59 -05009607071191161http://forums.asp.net/p/960707/1191161.aspx/1?+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+"The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" Hello. I tried to convert a project from ASP.NET 1.1 to 2.0 and found one big problem which stops the whole process. An .aspx page from the subfolder &quot;admin&quot; includes a user control from the subfolder &quot;common&quot;. Both subfolders (&quot;admin&quot; and &quot;common&quot; are in the root). root - admin -- aspx page - common -- user control The page works well when started from Visual Studio, but when the project is precompiled for deployment, the next error occurs: &quot;The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)&quot; I tried to use &quot;Reference&quot; in the .aspx page, but that doesn't work. Does anybody know any workaround for this? 2006-02-07T18:41:50-05:001191603http://forums.asp.net/p/960707/1191603.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>Hi Net,</p> <p>Could you post some sample code of how the user control is being referenced?</p> <p>Also -- how are you using the user-control?&nbsp; Are you programmatically referencing it, or simply declarating and using it on a page?</p> <p>Lastly -- does it work when you compile and run in Visual Studio?&nbsp; Is it only when you do a publish that it fails?</p> <p>Thanks,</p> <p>Scott</p> 2006-02-08T05:42:18-05:001192196http://forums.asp.net/p/960707/1192196.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" Hello Scott, Thank you for the reply. I don't use it in the code, just declare it in the way (declaration, usage): ------------------------------------------ Register Src=&quot;../common/WebUserControl.ascx&quot; TagName=&quot;WebUserControl&quot; TagPrefix=&quot;uc1&quot; ... uc1:WebUserControl ID=&quot;WebUserControl1&quot; runat=&quot;server&quot; ------------------------------------------- (I removed some symbols to make the code appear). I also tried to include &quot;Reference&quot; directive at the page top, but that didn't work. Everything works when I compile the application, even when I launch it from Visual Studio (Shift&#43;F5). This is the point where a hidden reef begins. When I precompiled the project (updatable), the page gives the error. I made several experiments and if I put the control into the same folder, where the page is, everything works ok. Also, I noticed that pages which are in the root can include any controls from &quot;common&quot; subfolder in the same way I described and it works. I.e. I understand that pages may include controls which are in &quot;subfolders&quot;, and the problems occur when they include controls from parallel folders. I think this is due to the new compilation model, but maybe there is some workaround. I was searching the forum, but didn't find anything helpful, expect suggestions to use &quot;Reference&quot;, which didn't help. Thanks. Ray. 2006-02-08T17:44:07-05:001192218http://forums.asp.net/p/960707/1192218.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>Hi Ray,</p> <p>You should be able to do this scenario just fine.&nbsp; If you are just using the control on a page, then you should be able to just use a &lt;%@ Register %&gt; directive (no refrence directive required).</p> <p>Can you send me via email (<a href="mailto:scottgu@microsoft.com">scottgu@microsoft.com</a>) a simple project that shows this problem?&nbsp; I can then help debug it more and figure out what is going on.</p> <p>Thanks,</p> <p>Scott</p> 2006-02-08T17:57:05-05:001192323http://forums.asp.net/p/960707/1192323.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" Hello Scott, I just sent the project to the e-mail you provided. The strange thing is that I tried to make a new project to show the problem and this one works fine. That's why I attached the converted full project. Regards, Ray. 2006-02-08T19:06:10-05:001236104http://forums.asp.net/p/960707/1236104.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>Hi guys,</p> <p>Did you manage to get anywhere with this? I have exactly the same problem.</p> <p>To make things even more confusing I have 5 user controls in a directory, 4 work fine but the 5th (and any subsequent ones I make) cause the error describe above.</p> <p>I've also noticed that when you publish the website a strange DLL is created. There are all of the normal DLLs&nbsp; (App_Web_xxxxxx.dll) but there is an extra one called App_Web_OffendingUserControlName.ascx.xxxxx.dll. This is only DLL that is named this way; and I get one of them for every user control that doesn't work.</p> <p>I can also confirm that moving the user control to the same directory as the page that it is used on resolves the issue.</p> <p>Regards,<br> Phil</p> 2006-03-23T22:53:29-05:001242890http://forums.asp.net/p/960707/1242890.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" Hi everyone,<br> &nbsp;&nbsp;&nbsp; I've the some annoyng problem....<br> Every time I have an upgrade to publish is a nightmare...<br> <br> my &quot;strange&quot; WebUC is in the &quot;admin&quot; subfolder and in the bin folder I have the extra dll &quot;App_Web_adminmenu.ascx.xxxxxx.dll&quot; and it is the only dll that is named in this way.<br> <br> I have found a solution that sometimes works...<br> <br> After having built the solution, in the pre-compiled site the page that gives me the problem has:<br> <br> &lt;%@ Register Src=&quot;../admin/adminMenu.ascx&quot; TagName=&quot;adminMenu&quot; TagPrefix=&quot;uc2&quot; %&gt;<br> <br> and the line that thrown the error:<br> <br> &lt;uc2:adminMenu ID=&quot;AdminMenu1&quot; runat=&quot;server&quot; /&gt;<br> <br> <br> The solution that sometimes work is to give to the UserControl ID the same name of the &quot;TagName&quot; or removing the ID; this pieces of code work:<br> <br> &lt;uc2:adminMenu ID=&quot;adminMenu&quot; runat=&quot;server&quot; /&gt;<br> <br> OR<br> <br> &lt;uc2:adminMenu runat=&quot;server&quot; /&gt;<br> <br> <br> <br> I hope this workaround should work for you too..<br> <br> Bye!<br> <br> PS: SOrry for my bad english...<br> 2006-03-30T15:00:46-05:001278996http://forums.asp.net/p/960707/1278996.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>Hi everyone,</p> <p>I have precisely the same problem <em>provided</em> that I request the compiled application to be updatable (-u switch on aspnet_compiler). Without the switch, the problem disappears.</p> <p>Best regards</p> <p>Birger</p> 2006-05-08T09:04:42-04:001298384http://forums.asp.net/p/960707/1298384.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p><font face="Verdana" size="2">I was getting this problem as well, and think I might have figured out what is going on.&nbsp; Of course if Scott Gu puts another post up here ... I would go with whatever he suggests.<br> <br> </font><font face="Verdana" size="2">The problem that I was having is that I was trying to precompile my site, and then move it to the live server that the site is actually hosted on.&nbsp; I was getting this error because the machine that I was coding on was running the 64-bit version of the .NET Framework 2.0 (which refers to the extensions at C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727).&nbsp; It turns out the computer that the site is hosted on is running the 32-bit version of the ASP.NET 2.0 (refers to the extensions at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727).<br> <br> So, what I am guessing is that when Visual Studio 2005 precompiles the code it does it with respect to a target version of the framework ... namely whatever version your computer is running.&nbsp; Then when I moved that code that was designed for the 64-bit version of the .NET Framework 2.0 over to the 32-bit version ... some things that didn't match up (there has to be some differences or you would refer to the same folder for extensions).<br> <br> The solution I came up with ... don't precompile the site.&nbsp; Move the files out there, and the first time the site is hit it will dynamically compile for whatever version of the .NET Framework the server is running.</font></p> 2006-05-27T20:44:47-04:001303389http://forums.asp.net/p/960707/1303389.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>Hi,</p> <p>DId you find any resolve to&nbsp;this issue? I am stuck in an identical problem.</p> <p>Please let me know</p> <p>Rajesh</p> 2006-06-02T11:32:23-04:001305247http://forums.asp.net/p/960707/1305247.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p><font color="#000000" size="2">Hi Guys</font></p> <p><font color="#000000" size="2">I think i found the solution........</font></p> <p><font color="#000000" size="2">Just change the CodeFile attribute in Usercontrol html in to CodeBehind ....it will work...</font></p> <p><font color="#000000" size="2">In asp.net 2003 usercountrol html&nbsp;u get the folowing declaration..</font></p> <p><font size="2"><font color="#000000">&lt;%</font><font color="#000000">@ Control Language=&quot;c#&quot; AutoEventWireup=&quot;true&quot; Inherits=&quot;xxxxxxxxxxx&quot; <font color="#ff0000">CodeFile</font>=&quot;xxxxxxxxxxxxxxxxs&quot; %&gt;</font></font></p> <p><font color="#000000" size="2">In asp.net 2005</font></p> <p><font color="#000000"><font size="2">&lt;%@ Control Language=&quot;c#&quot; AutoEventWireup=&quot;true&quot; Inherits=&quot;xxxxxxxxxx&quot; <font color="#ff0000">CodeBehind</font>=&quot;xxxxxxxxxxxxxx&quot; %&gt;</font></p> </font> <p><font color="#000000" size="2">Rgds</font></p> <p><font color="#000000" size="2">Maduka</font></p> <font size="2"></font> 2006-06-05T10:26:32-04:001309471http://forums.asp.net/p/960707/1309471.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>I can report that changing to CodeBehind did indeed solve the issue. (also reporting that&nbsp;I had the issue)&nbsp; Doesn't make much sense tho since i have another page that works just fine with the CodeFile attribute.</p> <p>The controls are nearly identical (created by a generator).</p> <p>&nbsp;</p> 2006-06-08T20:27:09-04:001309605http://forums.asp.net/p/960707/1309605.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>So this happens every time i regenerate my code, (using .NetTiers and codesmith). </p> <p>(I'm leaving it codefile instead of codebehind as I believe codefile is supposed to be the preferred syntax).</p> <p>to let you know my configuration:</p> <p>I'm using the webadmin controls generated by .NetTiers in a Web Application Project.&nbsp; The error occurs when I run it on my local machine.</p> <p>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.</p> <p>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.</p> <p>&nbsp;</p> 2006-06-08T23:00:22-04:001309799http://forums.asp.net/p/960707/1309799.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>Hi</p> <p>try to create a new usercontrol in vs.net 2005. It will create as CodeBehind not as CodeFile. I guess&nbsp;CodeBehind is the&nbsp;suitable property in the vs.net 2005.</p> <p>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&nbsp;try to use an user control of vs.net 2003 version, this error occurs.</p> <p>Rgds</p> <p>Maduka</p> 2006-06-09T05:05:17-04:001347473http://forums.asp.net/p/960707/1347473.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <blockquote><span class="icon-blockquote"></span> <h4>ScottGu</h4> <p>Hi Ray,</p> <p>You should be able to do this scenario just fine.&nbsp; If you are just using the control on a page, then you should be able to just use a &lt;%@ Register %&gt; directive (no refrence directive required).</p> <p>Can you send me via email (<a href="mailto:scottgu@microsoft.com">scottgu@microsoft.com</a>) a simple project that shows this problem?&nbsp; I can then help debug it more and figure out what is going on.</p> <p>Thanks,</p> <p>Scott</p> </blockquote> 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 :)<br> 2006-07-21T01:28:07-04:001348630http://forums.asp.net/p/960707/1348630.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" I have the same issue.<br> 2006-07-22T12:37:51-04:001476027http://forums.asp.net/p/960707/1476027.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>I had the same problem.&nbsp; 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:</p> <pre class="prettyprint">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).</pre>&nbsp;Check out this link: <a href="http://support.microsoft.com/kb/919284">http://support.microsoft.com/kb/919284</a> 2006-11-25T05:28:24-05:001490189http://forums.asp.net/p/960707/1490189.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>I was having the same issue and ran across this thread. This was only happening to me when I did a precompiled site.&nbsp; I noticed in the compiled ASCX file, it said </p> <p>&lt;%@ control language=&quot;C#&quot; autoeventwireup=&quot;true&quot; inherits=&quot;ApplicationContactTypeCheckBoxList, App_Web_dbsj1fkk&quot; %&gt;<br> <br> However, in my bin folder, there was a file called App_Web_applicationcontacttypecheckboxlist.ascx.77ebd44d.dll</p> <p>When I changed the inherits to inherits=&quot;ApplicationContactTypeCheckBoxList, App_Web_applicationcontacttypecheckboxlist.ascx.77ebd44d&quot; the problem went away.&nbsp; Seems to me that Visual Studio is putting the wrong type in the inherits property, or it's compiling that user control into&nbsp;a different assembly for some reason.&nbsp; &nbsp;All of the other user controls in that folder are inheriting from &quot;App_Web_dbsj1fkk&quot;.</p> <p>Then out of curiosity, I took a look at both DLLs in the object browser.</p> <p><img src="http://dev.tenringhosting.com/trhimg/fffa8faa-43f3-4517-866b-274db44e4dcd.jpg"></p> <p>That user control is compiled into both DLLs.&nbsp; There's more going on here than I fully understand, but I have a useable workaround for now.&nbsp; </p> 2006-12-07T21:24:14-05:001514093http://forums.asp.net/p/960707/1514093.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>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.</p> <p>As it is an intermittent problem, I have found it impossible to recreate. I do, however, have a solution of sorts.</p> <p>If you dont have admin access to the IIS server involved you're not going to be able to use this solution.</p> <p>As soon as you get the &quot;base class usercontrol error&quot;, get access to the IIS server where the site is hosted.</p> <p>1) Open the properties for the offending site.<br> 2) Select the Home Directory tab<br> 3) Under Application Settings, click Remove<br> 4)&nbsp;Create a new Application using the same button<br> <br> That should sort out all the bad class references.<br> <br> <br> </p> 2007-01-01T10:16:10-05:001546621http://forums.asp.net/p/960707/1546621.aspx/1?Re+The+base+class+includes+the+field+WebUserControl1+but+its+type+common_WebUserControl+is+not+compatible+with+the+type+of+control+ASP+common_webusercontrol_ascx+Re: "The base class includes the field 'WebUserControl1', but its type (common_WebUserControl) is not compatible with the type of control (ASP.common_webusercontrol_ascx)" <p>All,</p> <p>Here is something...</p> <p>I use a control called &quot;Address&quot;. It is a simple address entry form. Use it in a couple of places.</p> <p>&nbsp;On my dev platform...</p> <p>I debug my code and on page &quot;A&quot; works, the other, page &quot;B&quot; gets the &quot;base class usercontrol error&quot;.</p> <p>When the site is on production...</p> <p>Page &quot;A&quot; doesn't work, and the page &quot;B&quot; does.</p> <p>The rest of the code is the same. Is it an IIS config issue?</p> <p>I am beating my head against the wall.</p> <p>HPB&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> 2007-01-24T15:13:11-05:00