Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 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 15th, 2006, 12:36 PM
Registered User
 
Join Date: Jan 2006
Location: Mumbai, Maharastra, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Assembly

Hi There,

I have some doubts about dotnet framework. If someone can please clear it.

I have read...

.Net Framework gives advantage of using dotnet application without registering with system registry. This is made possible due to following reasons

.Net can automatically locate referenced assemblies. It contains manifest which has information about assemblies information with other assemblies.

Does it mean that the folder of dotnet application directory has all referenced files. If so then isn't it waste of diskspace if i already have the file in harddisk in someother location.when a dotnet application is copied from one computer to other it copies all the files even though if they are there. Does it finds out before copying the application wheather all refered dll files are there or not?

Thanking you and waiting for some kind replies.

Amit



 
Old January 15th, 2006, 11:42 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

To a certain extent, yes, it could be a waste of space. However, typically you won't have the same application in multiple places on the same machine.

Let's take an example of a program "MyProgram.exe" and a helper assembly "MyProgram.Helpers.dll". "MyProgram" is the programs namespace and "MyProgram.Helpers" is the DLL's namespace. When you run a MyProgram.exe, and that program to use a class from MyProgram.Helpers the framework will first look in the directory that the application is running for a library (DLL) that contains the "MyProgram.Helpers" namespace. If it doesn't find it there, it will then look in the GAC. (I believe there are ways of telling a program where else it can look for assemblies but I've never done it.) If the framework can't find the assembly it will throw an exception and tell you that it can't find a referenced assembly.

ASP.NET application are a little different. The execution directory of the application is the virtual directory established in IIS. Executable binaries must live inside the bin\ folder of the directory.

Assemblies that are commonly used such as those that make up the base .NET framework, are placed into the framework's Global Assembly Cache (GAC). Having an assembly in the GAC is kind of like registering it like you would a COM component. You can then reference an assembly namespace from anywhere on the computer. An important feature of the GAC is that it is aware of more than just the name of the assembly. The GAC can maintain several versions of the same assembly. Programs reference a specific version of a namespace in addition to the namespace. You can install version 1.0, 1.1 and 2.0 of the .NET framework on the same machine. When you build a program with version 1.1, the program references the 1.1 versions of the framework.

-Peter




Similar Threads
Thread Thread Starter Forum Replies Last Post
New to Assembly OnlyHuman925 Assembly Language 4 January 10th, 2010 07:28 AM
Assembly upadhyayharish83 ASP.NET 3.5 Basics 1 August 5th, 2008 01:25 AM
Converting .NET 2.0 Assembly to .Net 1.x Assembly pskaushik .NET Framework 2.0 1 November 25th, 2006 01:51 PM
assembly sreenu.pocha C# 4 July 26th, 2006 07:31 AM
Assembly arv1980 .NET Framework 2.0 1 January 15th, 2006 02:12 PM





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