473,385 Members | 2,014 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,385 software developers and data experts.

Referencing your other assemblies in projects

What is the recommended practice for referencing assemblies in a project
from other solutions?

I am using Visual Studio 2005 Team System. I have several assemblies in
another solution which will be referenced in my project. How should i
reference them.

e.g.

1) Should I get both solutions from source safe then point to the assembly
in the release of that project directory (whereever I store the project
directories)

2) Install the assembly on the local development machine (Common
Files/GAC/otherwise) then browse to the assembly.

3) Add the projects to my solution then use the reference assemblies from
this solution tab.

4) Is there no real best-practice for this.

Thanks In Advance
Dave Anson
Oct 1 '07 #1
1 2092

My company sets up a "Release" folder for commonly used assemblies.

C:\Inetpub\wwwroot\DotNet\v11\Assemblies\Framework \Release
C:\Inetpub\wwwroot\DotNet\v11\Assemblies\Framework \Beta
Then when I write an application (DietCodeManager for example)

C:\Inetpub\wwwroot\DotNet\v11\Source\Applications\ DietCokeManager

the solution/project files go there
C:\Inetpub\wwwroot\DotNet\v11\Source\Applications\ DietCokeManager\DietCokeManager.sln

C:\Inetpub\wwwroot\DotNet\v11\Source\Applications\ DietCokeManager\Presentation.Winforms1\
C:\Inetpub\wwwroot\DotNet\v11\Source\Applications\ DietCokeManager\BusinessLogic\
C:\Inetpub\wwwroot\DotNet\v11\Source\Applications\ DietCokeManager\DAL\
C:\Inetpub\wwwroot\DotNet\v11\Source\Applications\ DietCokeManager\SqlScripts\
Then,
lets say I have my own IO library (my company's code)
C:\Inetpub\wwwroot\DotNet\v11\Source\Framework\MyC ompany.IO\
the above is where the source goes

The .dll , after tested and built, gets put into
C:\Inetpub\wwwroot\DotNet\v11\Assemblies\Framework \Release\MyCompany.IO.dll

Then, the dietcoke manager (whichever layer) can relatively reference the
file, usually like this
...\..\Framework\Release\MyCompany.IO.dll
(this would be in the .csproj file for example)
When we went to 2.0, new code was created in this base structure:
C:\Inetpub\wwwroot\DotNet\v20\
(everything else the same)

.........

Your #3. Good for developing, but not good for permenant. Remember, you
may have release versions of MyCompany.IO.dll, and
only after good testing, should MyCompany.IO.dll be moved to
(C:\Inetpub\wwwroot\DotNet\v11\Assemblies\Framewor k\Release)
You can't work with release versions if you have a reference "By Project".
Your #2. Overkill for alot of scenarios. GAC'ing should be done frugally.
In a group environment, its CRUCIAL to get everyone on the same page.

You don't necessarily have to use the C:\inetpub thing
C:\Inetpub\wwwroot\DotNet\v11\

but .... you have to PICK something

C:\development\DotNet\v11\
and as long as you can enforce everyone to use this, you'll be ok.

I like the C:\Inetpub\wwwroot\DotNet\v11\
(aka, under inetpub somewhere)
because you can create web applications that still can relatively reference
an assembly.

This has become less of an issue with 2.0, and its non-IIS web testing
ability.
The solution above is one that took my company a while to iron out.

It allows for relative references (crucial in a team environment).
It allows for 1.1 and 2.0 code development. (v11 and v20).
It allows for release/beta release scenarios of common assemblies.
It allows for multiple developers, along as everyone adopts the same mapping
from SourceSafe to "Set Working Folder".
(In fact, in the root diretory of our VSS database, I have 1 text file
that says... YOU MUST SET YOUR WORKING FOLDER TO THIS VALUE, on the vss root
folder that is)
(It looks like this:
The "$" inside of VSS (Framework11VSS database) should be set
(working directory) to:
C:\Inetpub\wwwroot\DotNet\v11\
)

We have 2 source databases as well.
Framework11VSS
Framework20VSS

Its easy to have 1 VSS database as well, just map the $ to
C:\Inetpub\wwwroot\DotNet\
and have 2 directories off of that
\v11\
\v20\

Good luck.


"Dave Anson" <da********@jazzthecat.co.ukwrote in message
news:Xn**********************************@216.196. 109.145...
What is the recommended practice for referencing assemblies in a project
from other solutions?

I am using Visual Studio 2005 Team System. I have several assemblies in
another solution which will be referenced in my project. How should i
reference them.

e.g.

1) Should I get both solutions from source safe then point to the assembly
in the release of that project directory (whereever I store the project
directories)

2) Install the assembly on the local development machine (Common
Files/GAC/otherwise) then browse to the assembly.

3) Add the projects to my solution then use the reference assemblies from
this solution tab.

4) Is there no real best-practice for this.

Thanks In Advance
Dave Anson

Oct 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: loretta.stokes | last post by:
I manage our nightly builds for all of our products. Since we have added our .NET assemblies to our nightly build, it has been a learning process. I have come across a couple of situations that I...
12
by: Mark Broadbent | last post by:
Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced. Firstly I have seen in the designer that for the namespace and many of its...
16
by: PromisedOyster | last post by:
Hi I have a situation where I want to use circular referencing. I have cut down the example for demonstration purposes. Say we have one executable (main.exe) and two DLLS (A1.dll and A2.dll)....
10
by: Doug Crabtree | last post by:
I am kinda new to the whole distribution process. I several programs that I am writing that use common .NET DLLs. I want each program to use the same DLLs in a "COMMON" folder. How do I get...
11
by: Jan | last post by:
I'm using the CSharpCodeProvider to buils some assemblies @ runtime which are never saved as files (cp.GenerateInMemory = true;). The generated assemblies are hierachically dependent on each other...
2
by: Jan | last post by:
Regarding my post "CSharpCodeProvider: referencing other generated "InMemory" assembly" 4/27/2006 and the blog from Greg Young http://geekswithblogs.net/gyoung/archive/2006/04/27/76533.aspx I...
5
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
I am experiencing a lot of speed issues on initial app loads where we are referencing 3rd party 1.1 assemblies from 2.0 code. Those 1.1 assemblies reference things like System.Windows.Forms...
1
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. ...
5
by: nelsonbrodyk | last post by:
Hey All, I have two projects, A and B. Inside Project A, I have a DataGrid class, that extends a third party libraries datagrid. So the class looks like: public class MyDataGrid :...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.