How do I put a exe-project and a dll-project in the same solution?


H

HONOREDANCESTOR

I would like to put a dll and a project in the same solution. So I
created a project (of type exe) and then I chose 'new project' (of
type class library) and picked the option 'same solution'. So it
looks like I created 2 projects in the same solution, which is what I
wanted to do.
However, I want the exe-project to call the dll-project. The dll
project has a class called "ClassSayThings", and a method called
"sayHello".
When I look in Solution Explorer, I see the following:

CallerOfDll
My Project
Form1.vb
TheCalledDLL
My Project
ClassSayThings.vb

(I wanted to change the name of the 'My Project' entries but I can't
find a way to do that.)

Now in the exe-project, I want to add a reference to the dll. I click
on 'Project-Add references' But I don't see the reference to
"TheCalledDLL" in the reference list of dotnet libraries, though I do
see a reference to the assembly 'TheCalledDll" in the "Projects" tab
of the 'add references' box.
Likewise, when I try to add a line of code to the caller as follows:
Dim NewClassInstance as TheCalledDll.ClassSayThings
I fail - there is no such type as "TheCalledDll.ClassSayThings'.
Is there something I am missing?
Thanks,
HA
 
Ad

Advertisements

R

rowe_newsgroups

I would like to put a dll and a project in the same solution. So I
created a project (of type exe) and then I chose 'new project' (of
type class library) and picked the option 'same solution'. So it
looks like I created 2 projects in the same solution, which is what I
wanted to do.
However, I want the exe-project to call the dll-project. The dll
project has a class called "ClassSayThings", and a method called
"sayHello".
When I look in Solution Explorer, I see the following:

CallerOfDll
My Project
Form1.vb
TheCalledDLL
My Project
ClassSayThings.vb

(I wanted to change the name of the 'My Project' entries but I can't
find a way to do that.)

Now in the exe-project, I want to add a reference to the dll. I click
on 'Project-Add references' But I don't see the reference to
"TheCalledDLL" in the reference list of dotnet libraries, though I do
see a reference to the assembly 'TheCalledDll" in the "Projects" tab
of the 'add references' box.
Likewise, when I try to add a line of code to the caller as follows:
Dim NewClassInstance as TheCalledDll.ClassSayThings
I fail - there is no such type as "TheCalledDll.ClassSayThings'.
Is there something I am missing?
Thanks,
HA


though I do
see a reference to the assembly 'TheCalledDll" in the "Projects" tab
of the 'add references' box.

Did you add a reference to this project? If so you should be set -
please note you'll still have to fully qualify all references to the
dll project, so I would recommend that you add an imports statement
for "TheCalledDll"

Thanks,

Seth Rowe
 
Ad

Advertisements

P

Phillip Taylor

I would like to put a dll and a project in the same solution. So I
created a project (of type exe) and then I chose 'new project' (of
type class library) and picked the option 'same solution'. So it
looks like I created 2 projects in the same solution, which is what I
wanted to do.
However, I want the exe-project to call the dll-project. The dll
project has a class called "ClassSayThings", and a method called
"sayHello".
When I look in Solution Explorer, I see the following:

CallerOfDll
My Project
Form1.vb
TheCalledDLL
My Project
ClassSayThings.vb

(I wanted to change the name of the 'My Project' entries but I can't
find a way to do that.)

Now in the exe-project, I want to add a reference to the dll. I click
on 'Project-Add references' But I don't see the reference to
"TheCalledDLL" in the reference list of dotnet libraries, though I do
see a reference to the assembly 'TheCalledDll" in the "Projects" tab
of the 'add references' box.
Likewise, when I try to add a line of code to the caller as follows:
Dim NewClassInstance as TheCalledDll.ClassSayThings
I fail - there is no such type as "TheCalledDll.ClassSayThings'.
Is there something I am missing?
Thanks,
HA

Both your EXE project and your DLL are in your solution, what you need
to do is, select the EXE project and choose the project menu > Add
refererences and then choose the "PROJECTS" tab. It should be listed
there.

If sucessfully added it should appear under the exe projects
References folder on the solution explorer.

It's also worth checking your namespace / classes and solution are
marked public is applicable.

And finally check that you have a line at the top of the place you
want to use it that says

Imports TheCalledDLL

good Luck

Phill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top