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 / Windows Forms / WinForm Controls / October 2004

Tip: Looking for answers? Try searching our database.

Custom/User controls cannot depend on other DLLs???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
~~~ .NET Ed ~~~ - 28 Oct 2004 23:05 GMT
I have the following problem. I have a custom/user control for windows
forms. This control depends on two other assemblies/dlls. I tried adding my
control to "My User Controls" using the "Add Items" option by using the
Browse button. I selected the DLL that contains the control (and this DLL is
only about that control and nothing else) and when I press "OK" I get an
error saying that one of its referenced assemblies (which by the way are in
the same directory) could not be found.

So, does it mean that a custom control or a user control assembly cannot
depend/reference any other assembly that is not in the GAC?

Thanks,
Emilio
~~~ .NET Ed ~~~ - 29 Oct 2004 15:15 GMT
Maybe I should rephrase this in hopes of getting an answer ;)

When one develops a custom/user control for windows forms, must it be
self-contained in a single DLL (ie, no dependency to other DLLs) in order
for it to be added to the VS.NET Toolbox?

My control for example, is named MyControl.dll, it depends on some common
classes that are from a different DLL (MyCommon.dll) as well as a separate
library that implements a custom license provider (MyProvider.dll). This
means that the output of a build of my control project produces the
following files in the bin directory:
       MyControl.dll    (my user control)
       MyProvider.dll      (custom license provider, shared by several
controls)
       MyCommon.dll     (common classes, shared by many projects)

Obviously the MyControl project *has* a reference to the other two DLLs.
When I try to add it to the Toolbox I get an error indicating that
"MyProvider or one of its dependent assemblies could not be found" which is
strange because all three reside in the same directory! and the control
project *has* a reference to them as well!

Yes, I think that ideally it would be self-contained but in this case -and I
imagine more complex controls also fall in this category- it is neither
practical nor wise to copy all the necessary classes from the other
assemblies into the control project only to satisfy this constraint. It
would be a maintenance nightmare, specially if you deploy several control
assemblies that have the same license provider!

I suppose I am missing some important information, what is it? I really
can't believe that a user control must not reference other "user" assemblies
for it to be deployable in a toolbox. As a result I can't drop my component
into the form. It was possible when all was in one assembly (no common code
usage and no license provider).

Help please =)
Emilio
> I have the following problem. I have a custom/user control for windows
> forms. This control depends on two other assemblies/dlls. I tried adding my
[quoted text clipped - 9 lines]
> Thanks,
> Emilio
James Westgate - 29 Oct 2004 16:45 GMT
Are these 3 controls signed and registered in the GAC?

James

Signature

Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

> Maybe I should rephrase this in hopes of getting an answer ;)
>
[quoted text clipped - 54 lines]
>> Thanks,
>> Emilio
~~~ .NET Ed ~~~ - 30 Oct 2004 00:06 GMT
Hi James,
  It is just one control contained in one assembly. But the logic in this
control's depends on classes from two other assemblies (one being the
license provider assembly).

The control's assembly, as well as the other two (dependent assemblies) are
signed with a strong key. But no they are not added to the GAC. I don't
think that is a requirement because I can add the other non-signed controls
to the toolbox without having to register them in the GAC.

Any other ideas?
Thx,
Emilio

> Are these 3 controls signed and registered in the GAC?
>
[quoted text clipped - 58 lines]
> >> Thanks,
> >> Emilio
James Westgate - 30 Oct 2004 01:57 GMT
If you register the two (dependent assemblies) in the GAC , either manually
or by using an installer, then when your control is added to the toolbox it
should find the other 2 assemblies in the GAC and not throw an error... this
is what Im guessing, havent tried it out though.

eg when you create a usercontrol dependant on the system .dlls it binds as
these dlls are registered in the GAC.

James

> Hi James,
>   It is just one control contained in one assembly. But the logic in this
[quoted text clipped - 88 lines]
>> >> Thanks,
>> >> Emilio

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.