Wrox Programmer Forums
|
BOOK: Visual Basic 2005 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2005 Programmer's Reference by Rod Stephens; ISBN: 9780764571985
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2005 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2007, 11:27 AM
Authorized User
 
Join Date: Dec 2006
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default IDE : sharing files between projects

I have 2 projects in my solution, and they need to share some modules, classes etc.

If I use Project/Add Existing Item from Project2 and reference a file in Project1, I get a [u]copy</u> of the file put into my Project2 folder.

How can I share the modules etc, so I have one version for both projects?

(BTW, I'm using VB Express)

 
Old January 27th, 2007, 11:14 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

I don't think you're supposed to do that. I can't find a reasonable way to do it.

I think what you're supposed to do is make a class library project and put the code you want to share in it. Then add a reference to the compiled DLL to your other project and use the classes in the DLL.

I think this is the same solution to the "Help! Its all gone horribly wrong!" topic.

Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html
 
Old January 30th, 2007, 05:45 AM
Authorized User
 
Join Date: Dec 2006
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It seems there is a rather hidden dropdown on the Project/Add existing item/Add button to Add as link. This gives adds a reference to the item rather than the item itself and works fine...

ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_vssoln/html/15f4cfb7-78ab-457f-9f14-099a25a6a2d3.htm

 
Old January 30th, 2007, 10:15 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Ah ha! You learn something new every day.

You should still keep the DLL solution in mind. That's the "right" way to do this. Linking will probably work for you but it could cause trouble if you had multiple developers working on all of the projects. If you use a DLL, you have more control over when changes to the DLL break compatibility so you know that you need to rebuild other projects.

Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html
 
Old February 9th, 2007, 08:12 AM
Authorized User
 
Join Date: Dec 2006
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's actually quite clever... if you have two copies of VB2005 running with projects that share a file, if you change the file in one, the other detects the change and offers to re-load it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing one dataset between forms hexOffender VB.NET 2002/2003 Basics 2 November 15th, 2006 10:41 AM
Sharing code GuyB CSS Cascading Style Sheets 1 July 6th, 2006 09:41 PM
Sharing code GuyB ASP.NET 2.0 Basics 2 July 6th, 2006 06:50 PM
Sharing a Folder adman VB How-To 4 December 19th, 2003 05:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.