Sharing a module in two projects

  • Thread starter Thread starter bnob
  • Start date Start date
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.
 
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.
 
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
 
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??
 
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
 
Back
Top