473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1211
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Harry Whitehouse | last post by:
I'm developing a small class which will be used in a number of distinct C# projects. This small class is undergoing constant change/refinement as I try to employ it in the different projects. ...
7
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to...
0
by: Martin Balog | last post by:
Hi, i have a solution with two projects opened. both projects have classes with the same name (for example CMainFrame) and the file name is the same, too. imagine i want to add a virtual...
1
by: Jody Gelowitz | last post by:
Within ASP.NET, is it possible to use a single .vb file and have it shared (or accessed) between multiple projects without having that file being copied to each project folder? ie....
1
by: Christopher W. Douglas | last post by:
I am building a VB.NET application in Visual Studio.NET 2003. I have an existing project with code and forms I want to reuse in this project. If I am copying a module file, then Add Existing Item...
2
by: Brian Henry | last post by:
is there any way to make an assembly file accessable across multiple projects (we have over 20 that need the info all to be the same at build version, title, desc, copyright,etc) i saw MS did this...
4
by: Bill Nguyen | last post by:
I would like to include a module from another project. When I added existing item, VS copied the module to the current project's folder so that whatever I did to this module doesn't reflect in the...
4
by: David W | last post by:
In VS .NET 2003 (SP1) I wanted to add a preprocessor symbol to all configurations of all projects in a solution. I selected all the projects and then went to Properties, where I went to the...
12
by: Jeff Gaines | last post by:
I am a hobbyist programmer, using C# and VS2008 and writing desktop apps. I am trying hard to take a modular approach to avoid re-inventing the wheel but I'm finding it a bit frustrating. For...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.