Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining multiple projects in the same Application

Status
Not open for further replies.

ehx6

IS-IT--Management
Joined
May 20, 2004
Messages
150
Location
US
Hi I am in the proceess to learn C# development . Why would an application contain multiple projects. What is the significant of having multiple projects in the same Application(Window or Web) Is there a benefit.

How would I know that I need to have multiple projects in the same Application, what I mean is what drives me to have multiple projects in the same Application. I am sure , there is a reason for it,but I do not know.

thanks for clarifying such issue in my mind.
Ehx
 
Often you'll break up an application into multiple assemblies in order to divide up responsibilities and avoid code duplication. A good example would be a "Util" class that all the other assemblies use.

When another Assembly needs to use the stuff inside Util, there are two choices to reference it ... you can point a reference at Util.dll, or you can add the Util.csproj into your solution.

Pointing at the DLL is good when Util.dll is fairly stable, and isn't going to be changing very much (if at all). Visual Studio will make a copy of it in your bin directory. If someone updates Util.dll, the DLL in your bin directory is now stale, and you need to reset the reference to get the new code. The advantage to this technique is that the DLL doesn't get built everytime you build your solution, saving you development time.

Including the .csproj in your solution (add existing project menu) solves the stale code problem, but it means that it gets built every time you build your solution. If you're on a slow machine, this will slow down your code-build-test cycle.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top