471,309 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,309 software developers and data experts.

Adding the same file to multiple projects.

UJ
I have a couple of files (type definitions, constants, ...) that I want to
use in multiple projects. How do I make it so that I have only one copy of
the file for multiple projects? If I do add existing to a project, it copies
the file to the project directory. I'd like to have a single directory
(called something like library) that has all the common source code in it
that then gets referenced from the projects.

TIA.

Jeffrey.
Nov 21 '05 #1
6 1121
"UJ" <UJ@nowhere.com> schrieb:
I have a couple of files (type definitions, constants, ...) that I want to
use in multiple projects. How do I make it so that I have only one copy of
the file for multiple projects? If I do add existing to a project, it
copies the file to the project directory. I'd like to have a single
directory (called something like library) that has all the common source
code in it that then gets referenced from the projects.


VS.NET provides a way to reference the file instead of creating a copy of
it: "Project" -> "Add Existing Item..." -> Change the button labeled "Open"
to "Reference File" and press it.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
How do you then distribute the application if the .dll of the common file
isn't in the bin directory of the application?

"Herfried K. Wagner [MVP]" wrote:
"UJ" <UJ@nowhere.com> schrieb:
I have a couple of files (type definitions, constants, ...) that I want to
use in multiple projects. How do I make it so that I have only one copy of
the file for multiple projects? If I do add existing to a project, it
copies the file to the project directory. I'd like to have a single
directory (called something like library) that has all the common source
code in it that then gets referenced from the projects.


VS.NET provides a way to reference the file instead of creating a copy of
it: "Project" -> "Add Existing Item..." -> Change the button labeled "Open"
to "Reference File" and press it.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
"Dennis" <De****@discussions.microsoft.com> schrieb:
How do you then distribute the application if the .dll of the common file
isn't in the bin directory of the application?


No need to distribute a separate DLL -- the file will be part of the project
and thus compiled into the final EXE/DLL file.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
VS.NET provides a way to reference the file instead of creating a copy of
it: "Project" -> "Add Existing Item..." -> Change the button labeled "Open"
to "Reference File" and press it.

Herfried
Does that apply to the standard edition - when I try I get the options,
open, open with and link file but not reference file. This is on VB 2003

thanks

Jon
Nov 21 '05 #5
That will work if you are adding a project or vb module to your main project
but if you adding a reference to a (compiled project, i.e., a .dll file) then
isn't this .dll automatically added to your project bin directory and you
have to distribute it with your application?

"Herfried K. Wagner [MVP]" wrote:
"Dennis" <De****@discussions.microsoft.com> schrieb:
How do you then distribute the application if the .dll of the common file
isn't in the bin directory of the application?


No need to distribute a separate DLL -- the file will be part of the project
and thus compiled into the final EXE/DLL file.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6
"Dennis" <De****@discussions.microsoft.com> schrieb:
That will work if you are adding a project or vb module to your main
project
but if you adding a reference to a (compiled project, i.e., a .dll file)
then
isn't this .dll automatically added to your project bin directory and you
have to distribute it with your application?


Yes, in this case you will have to distribute the DLL too.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Harry Whitehouse | last post: by
reply views Thread by Martin Balog | last post: by
1 post views Thread by Jody Gelowitz | last post: by
1 post views Thread by Christopher W. Douglas | last post: by
4 posts views Thread by Bill Nguyen | last post: by
12 posts views Thread by Jeff Gaines | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.