Sharing a module in two projects

B

bnob

I have a VB.NET solution with two projects (Project1, Project2).

I want to call from Project2 a function in a module. But this module is in
the Project1.
How can I call this function ? Must I write a dll ?

Thanks in advance for your answer.
 
R

Russ Ryba

bnob said:
I have a VB.NET solution with two projects (Project1, Project2).

I want to call from Project2 a function in a module. But this module is in
the Project1.
How can I call this function ? Must I write a dll ?

Thanks in advance for your answer.
In Project2, use Add Existing Item and add the module from Project1 to
Project2. I do have several projects that use shared modules between
them. This allows me to have a desktop and a handheld application use
the same classes, with the GUI's being very different.
 
D

Daniel Moth

Note that if you really want to be using the same file you should choose
"Link to file" and not just "Open" as that creates a copy. Naturally the
best way to share code between different projects is via a Class Library (or
dll as you say).

Cheers
Daniel
 
B

bnob

Daniel Moth avait énoncé :
Note that if you really want to be using the same file you should choose
"Link to file" and not just "Open" as that creates a copy. Naturally the best
way to share code between different projects is via a Class Library (or dll
as you say).

Cheers
Daniel

But when I add my module as "link to file", I've got error "This
directory have a file with the same name"

Why??
 
D

Daniel Moth

I have never seen this myself but I guess you have a file with the same name
in that directory. "That" being the project's directory, try changing the
file name.

Cheers
Daniel
 

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