By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,479 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,479 IT Pros & Developers. It's quick & easy.

How to share projects between solutions

P: n/a
I have an application that I am developing that is a front end for a SQL
database. We will also be developing a subset of the UI that will work as a
(mainly) standalone client that will make a connection to the database, copy
the relevant data to a local file, and disconnect from the database. The
users will then be able to make modifications using the UI, and when a
connection is available they can connect and upload their changes. Since I
want the majority of the UI to be the same for both clients, I have divided
up my solution for the main (always connected) client to seperate the
sections that will be used in both applications from those that will be
unique to one or the other. My question is: what are the mechanics of using
a project in multiple solutions, particularly in that some of the items that
the shared project must reference will be different between the 2 solutions.
(E.G. there will be a DataConnection reference which in the connected client
will need to connect to the database and in the disconnected client will
need to "connect" to the local file.)

TIA
Ron L
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Instead of sharing whole projects, I would share code files. That is, I
would create 2 projects but using the same code files from a shared folder.
You can use shared code files using Add Existing Item menu of a project, and
in the dialog drop down the Open button (with an arrow) and use Link File
instead of Open.

Also, you may want to use conditional compilation is some file or method
must have a different behavior depending on the project. Projects allow you
to define compilation constants (Project properties, Configuration
Properties, Build node) and you can use them in your code:

#If PROJECT_A Then
' Connect to remote database
....
#Else
' Connect to local database
....
#End If

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Ron L" <ro**@bogus.Address.com> escribió en el mensaje
news:u3**************@TK2MSFTNGP10.phx.gbl...
I have an application that I am developing that is a front end for a SQL
database. We will also be developing a subset of the UI that will work as
a (mainly) standalone client that will make a connection to the database,
copy the relevant data to a local file, and disconnect from the database.
The users will then be able to make modifications using the UI, and when a
connection is available they can connect and upload their changes. Since I
want the majority of the UI to be the same for both clients, I have divided
up my solution for the main (always connected) client to seperate the
sections that will be used in both applications from those that will be
unique to one or the other. My question is: what are the mechanics of
using a project in multiple solutions, particularly in that some of the
items that the shared project must reference will be different between the
2 solutions. (E.G. there will be a DataConnection reference which in the
connected client will need to connect to the database and in the
disconnected client will need to "connect" to the local file.)

TIA
Ron L

Nov 21 '05 #2

P: n/a
Carlos
Thank you for the response. I had been wondering if seperate projects
with common code files was the way to do it, or if there was a better way.

Ron L

"Carlos J. Quintero [.NET MVP]" <ca*****@NOSPAMsogecable.com> wrote in
message news:uO**************@TK2MSFTNGP14.phx.gbl...
Instead of sharing whole projects, I would share code files. That is, I
would create 2 projects but using the same code files from a shared
folder. You can use shared code files using Add Existing Item menu of a
project, and in the dialog drop down the Open button (with an arrow) and
use Link File instead of Open.

Also, you may want to use conditional compilation is some file or method
must have a different behavior depending on the project. Projects allow
you to define compilation constants (Project properties, Configuration
Properties, Build node) and you can use them in your code:

#If PROJECT_A Then
' Connect to remote database
...
#Else
' Connect to local database
...
#End If

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Ron L" <ro**@bogus.Address.com> escribió en el mensaje
news:u3**************@TK2MSFTNGP10.phx.gbl...
I have an application that I am developing that is a front end for a SQL
database. We will also be developing a subset of the UI that will work as
a (mainly) standalone client that will make a connection to the database,
copy the relevant data to a local file, and disconnect from the database.
The users will then be able to make modifications using the UI, and when a
connection is available they can connect and upload their changes. Since
I want the majority of the UI to be the same for both clients, I have
divided up my solution for the main (always connected) client to seperate
the sections that will be used in both applications from those that will
be unique to one or the other. My question is: what are the mechanics of
using a project in multiple solutions, particularly in that some of the
items that the shared project must reference will be different between the
2 solutions. (E.G. there will be a DataConnection reference which in the
connected client will need to connect to the database and in the
disconnected client will need to "connect" to the local file.)

TIA
Ron L


Nov 21 '05 #3

P: n/a
Hi Ron,

Notice that while you can create different configurations for a project,
such as ProjectA_Debug, ProjectA_Release, ProjectB_Debug,ProjectB_Release,
the assembly name is the same for all of them (it is not configurable per
configuration, only the output folder), so if you want 2 assemblies, you
need 2 projects...

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Ron L" <ro**@bogus.Address.com> escribió en el mensaje
news:OO*************@TK2MSFTNGP10.phx.gbl...
Carlos
Thank you for the response. I had been wondering if seperate projects
with common code files was the way to do it, or if there was a better way.

Ron L


Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.