Sharing files across projects

G

Guest

I have a VB.NET class library project and two other VB.NET projects that
depend on that class library, ie:

Class library
--Project 1
--Project 2

Currently, as you'd expect, when I compile this, each of Project 1 and 2 end
up with an exe and a dll. However, I don't want the project to be distributed
with a dll, so is it possible to add the files to each of the Projects
directly (so that they are sharing the files in the class library -- not such
that each gets a separate copy) rather than using the class library as a
dependency. In this way, if I update the class library, both project file
sets will also be updated. And when I compile each project, the resulting
output will only be an exe?
 
H

Herfried K. Wagner [MVP]

Andrew E Chapman said:
Currently, as you'd expect, when I compile this, each of Project 1 and 2
end
up with an exe and a dll. However, I don't want the project to be
distributed
with a dll, so is it possible to add the files to each of the Projects
directly (so that they are sharing the files in the class library -- not
such
that each gets a separate copy) rather than using the class library as a
dependency. In this way, if I update the class library, both project file
sets will also be updated. And when I compile each project, the resulting
output will only be an exe?

Click "Add Existing Item...", select the file, and then change the
dropdown button to reference the file only and keep it in its original
location.
 
G

Guest

Thanks, that sort of worked. The program would compile and run, but there is
now a problem with serialization. Project1 and Project2 pass serialized
binary data to one another, but when Project2 now attempts to deserialize
data from Project1 it throws a "Cannot find assembly Project1" error, which
was not occuring before when the class library was compiling into a dll.

From my reading I understand this is something to do with versioning, but
I've no idea how to fix it.
 

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