By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,799 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,799 IT Pros & Developers. It's quick & easy.

It's not possible to call method in a class library dll from a user control dll

P: n/a
Hello!

I have one solution file that consist of three project.
One project that build the exe file called A
One project that build a user control dll. Here we have a class called B
One project that build a class library dll. Here we have a class called C

We have one dependency and that is from the user control to the class
library because
in the constructor for class B in the user control we have a call to
instansiate class C in the class library dll.
public B()
{
InitializeComponent();
Last.C last = new Last.C();
last.foo();
}

In the project that create the exe file I have a project reference to the
user control.
In the project that create the user control I have a project reference to
the class library.

When I add the user control to the Toolbox I use the obj/debug directory to
select the user control dll.

Now to my problem when I try to drag the user control from the toolbox into
a form I get the following error "An exception occured while trying to
create an instance of WindowsControlLibrary.B. The execption was "?"."

Is this kind of a bug that cause this problem.
Is it possible to solve this kind of problem in some way.
I have even rebuild the user control dll and the class library dll but it
doesn't matter.
//Tony
I just wonder what is the requirement about the dll and its version on the
dll

I noticed that when I get error



Apr 2 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Tony,

The problem doesn't stem from the fact that the User Control assembly
references the assembly it depends on, and that the executable references
the User Control assembly. I know that for a fact because I have done this
many times. What I don't know is what caused the error.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Tony Johansson" <jo*****************@telia.com> wrote in message
news:93*******************@newsb.telia.net...
Hello!

I have one solution file that consist of three project.
One project that build the exe file called A
One project that build a user control dll. Here we have a class called B
One project that build a class library dll. Here we have a class called C

We have one dependency and that is from the user control to the class
library because
in the constructor for class B in the user control we have a call to
instansiate class C in the class library dll.
public B()
{
InitializeComponent();
Last.C last = new Last.C();
last.foo();
}

In the project that create the exe file I have a project reference to the
user control.
In the project that create the user control I have a project reference to
the class library.

When I add the user control to the Toolbox I use the obj/debug directory
to select the user control dll.

Now to my problem when I try to drag the user control from the toolbox
into a form I get the following error "An exception occured while trying
to create an instance of WindowsControlLibrary.B. The execption was "?"."

Is this kind of a bug that cause this problem.
Is it possible to solve this kind of problem in some way.
I have even rebuild the user control dll and the class library dll but it
doesn't matter.
//Tony
I just wonder what is the requirement about the dll and its version on the
dll

I noticed that when I get error



Apr 2 '06 #2

P: n/a
Hi!

When I have this kind of problem what is the solution?
If I put the class library in the GAC that is called by the user control
would that solve my problem?

Do you think that this could be a bug because you have experienced this
kind of problem yourself.

I see that you are Microsoft MVP so do you think it's possible to send a
mail to microsoft telling them about my problem.

//Tony

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:uX**************@TK2MSFTNGP09.phx.gbl...
Hi Tony,

The problem doesn't stem from the fact that the User Control assembly
references the assembly it depends on, and that the executable references the User Control assembly. I know that for a fact because I have done this many times. What I don't know is what caused the error.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Tony Johansson" <jo*****************@telia.com> wrote in message
news:93*******************@newsb.telia.net...
Hello!

I have one solution file that consist of three project.
One project that build the exe file called A
One project that build a user control dll. Here we have a class called B One project that build a class library dll. Here we have a class called C
We have one dependency and that is from the user control to the class
library because
in the constructor for class B in the user control we have a call to
instansiate class C in the class library dll.
public B()
{
InitializeComponent();
Last.C last = new Last.C();
last.foo();
}

In the project that create the exe file I have a project reference to the user control.
In the project that create the user control I have a project reference to the class library.

When I add the user control to the Toolbox I use the obj/debug directory to select the user control dll.

Now to my problem when I try to drag the user control from the toolbox
into a form I get the following error "An exception occured while trying to create an instance of WindowsControlLibrary.B. The execption was "?"."
Is this kind of a bug that cause this problem.
Is it possible to solve this kind of problem in some way.
I have even rebuild the user control dll and the class library dll but it doesn't matter.
//Tony
I just wonder what is the requirement about the dll and its version on the dll

I noticed that when I get error






Apr 2 '06 #3

P: n/a
You misunderstood me, Tony. I have never had this problem. I have
successfully done the same thing you're trying to do without any problems,
and no, I didn't use the GAC.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Tony Johansson" <jo*****************@telia.com> wrote in message
news:Pm*******************@newsb.telia.net...
Hi!

When I have this kind of problem what is the solution?
If I put the class library in the GAC that is called by the user control
would that solve my problem?

Do you think that this could be a bug because you have experienced this
kind of problem yourself.

I see that you are Microsoft MVP so do you think it's possible to send a
mail to microsoft telling them about my problem.

//Tony

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:uX**************@TK2MSFTNGP09.phx.gbl...
> Hi Tony,
>
> The problem doesn't stem from the fact that the User Control assembly
> references the assembly it depends on, and that the executable

references
> the User Control assembly. I know that for a fact because I have done

this
> many times. What I don't know is what caused the error.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> Professional Numbskull
>
> Show me your certification without works,
> and I'll show my certification
> *by* my works.
>
> "Tony Johansson" <jo*****************@telia.com> wrote in message
> news:93*******************@newsb.telia.net...
>> Hello!
>>
>> I have one solution file that consist of three project.
>> One project that build the exe file called A
>> One project that build a user control dll. Here we have a class called B >> One project that build a class library dll. Here we have a class called C >>
>> We have one dependency and that is from the user control to the class
>> library because
>> in the constructor for class B in the user control we have a call to
>> instansiate class C in the class library dll.
>> public B()
>> {
>> InitializeComponent();
>> Last.C last = new Last.C();
>> last.foo();
>> }
>>
>> In the project that create the exe file I have a project reference to the >> user control.
>> In the project that create the user control I have a project reference to >> the class library.
>>
>> When I add the user control to the Toolbox I use the obj/debug directory >> to select the user control dll.
>>
>> Now to my problem when I try to drag the user control from the toolbox
>> into a form I get the following error "An exception occured while trying >> to create an instance of WindowsControlLibrary.B. The execption was "?"." >>
>> Is this kind of a bug that cause this problem.
>> Is it possible to solve this kind of problem in some way.
>> I have even rebuild the user control dll and the class library dll but it >> doesn't matter.
>>
>>
>> //Tony
>>
>>
>> I just wonder what is the requirement about the dll and its version on the >> dll
>>
>> I noticed that when I get error
>>
>>
>>
>>
>>
>>
>>
>>

>
>



Apr 2 '06 #4

P: n/a
Hello!

When I'm in design mode and drag the user control from the toolbox into
a form that exist in the project that build the exe file which search path
is used to locate the class library dll.

Many thanks

//Tony
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:e#**************@TK2MSFTNGP10.phx.gbl...
You misunderstood me, Tony. I have never had this problem. I have
successfully done the same thing you're trying to do without any problems,
and no, I didn't use the GAC.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Tony Johansson" <jo*****************@telia.com> wrote in message
news:Pm*******************@newsb.telia.net...
Hi!

When I have this kind of problem what is the solution?
If I put the class library in the GAC that is called by the user control would that solve my problem?

Do you think that this could be a bug because you have experienced this
kind of problem yourself.

I see that you are Microsoft MVP so do you think it's possible to send a mail to microsoft telling them about my problem.

//Tony

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:uX**************@TK2MSFTNGP09.phx.gbl...
> Hi Tony,
>
> The problem doesn't stem from the fact that the User Control assembly
> references the assembly it depends on, and that the executable

references
> the User Control assembly. I know that for a fact because I have done

this
> many times. What I don't know is what caused the error.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> Professional Numbskull
>
> Show me your certification without works,
> and I'll show my certification
> *by* my works.
>
> "Tony Johansson" <jo*****************@telia.com> wrote in message
> news:93*******************@newsb.telia.net...
>> Hello!
>>
>> I have one solution file that consist of three project.
>> One project that build the exe file called A
>> One project that build a user control dll. Here we have a class called
B
>> One project that build a class library dll. Here we have a class

called C
>>
>> We have one dependency and that is from the user control to the
class >> library because
>> in the constructor for class B in the user control we have a call to
>> instansiate class C in the class library dll.
>> public B()
>> {
>> InitializeComponent();
>> Last.C last = new Last.C();
>> last.foo();
>> }
>>
>> In the project that create the exe file I have a project reference to the
>> user control.
>> In the project that create the user control I have a project
reference to
>> the class library.
>>
>> When I add the user control to the Toolbox I use the obj/debug

directory
>> to select the user control dll.
>>
>> Now to my problem when I try to drag the user control from the
toolbox >> into a form I get the following error "An exception occured while

trying
>> to create an instance of WindowsControlLibrary.B. The execption was

"?"."
>>
>> Is this kind of a bug that cause this problem.
>> Is it possible to solve this kind of problem in some way.
>> I have even rebuild the user control dll and the class library dll

but it
>> doesn't matter.
>>
>>
>> //Tony
>>
>>
>> I just wonder what is the requirement about the dll and its version
on the
>> dll
>>
>> I noticed that when I get error
>>
>>
>>
>>
>>
>>
>>
>>
>
>




Apr 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.