Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Nested user control causes build errors due to missing reference

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sebastian Paul - 27 Jul 2007 16:20 GMT
Hi,

I have a user control (EventStructureSelector) used in another user
control (ResultsMenu).

The class EventStructureSelector defines a public type (ModeType),
that is used for one of its properties (Mode). The class ResultsMenu
sets the property of the nested control during the PageLoad event.

No big thing for now.

But when adding the ResultsMenu control to a page, I get a build error
for the page (not the control):
The type 'EventStructureSelector.ModeType' is defined in an assembly
that is not referenced. You must add a reference to assembly
'App_Web_eventstructureselector.ascx.3933a83e.ma7j9ksk,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

Of course, I have correctly registered the ResultsMenu user control,
but that is not enough - I have to register EventStructureSelector!
This is strange, because the page has nothing to do with the nested
control, and the ResultsMenu control already has the Register
directive for EventStructureSelector.

Sure, one can live with it, but a user control should fully
encapsulate the nested controls.

I tried to register both controls globally in the web config, but I
got a similar error.

Best regards, Sebastian
bruce barker - 27 Jul 2007 16:48 GMT
.net compilers need to load all referenced libraries to do a compile,
thus when asp.net compiles a page, it needs to know this info.

-- bruce (sqlwork.com)

> Hi,
>
[quoted text clipped - 27 lines]
>
> Best regards, Sebastian
Sebastian Paul - 27 Jul 2007 17:04 GMT
> .net compilers need to load all referenced libraries to do a compile,
> thus when asp.net compiles a page, it needs to know this info.
Sure. But it doesn't has this info. The ASP.NET compiler should
recognize the dependency between the controls, shouldn't he?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.