Search this blog

Showing posts with label Assembly. Show all posts
Showing posts with label Assembly. Show all posts

Monday, November 9, 2009

What is Strong Name in .NET?

Strong Name is a simple English word, which is used for Assembly Identity. It may be simple text name, version number, and culture information (if provided) — plus a public key and a digital signature. 


Strong name is similar to GUID(It is supposed to be unique in space and time) in COM components.Strong Name is only needed when we need to deploy assembly in GAC.Strong Names helps GAC to differentiate between two versions.Strong names use public key cryptography(PKC) to ensure that no one can spoof it. PKC use public key and private key concept.

What is Manifest?


Assembly metadata is stored in Manifest. Manifest contains all the metadata needed to do the following things.
  • Version of assembly
  • Security identity
  • Scope of the assembly
  • Resolve references to resources and classes.
  • The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate languages (MSIL) code or in stand-alone PE file that contains only assembly manifest information.

Difference between Namespace and Assembly

Following are the difference between Namespace and Assembly:


1. assembly is a physical grouping of logical units
2. namespace logically groups classes
3. namespace can span multiple assembly

Tuesday, October 27, 2009

ILMerge


ILMerge is a utility that can be used to merge multiple .NET assemblies into a single assembly. ILMerge takes a set of input assemblies and merges them into one target assembly. The first assembly in the list of input assemblies is the primary assembly. When the primary assembly is an executable, then the target assembly is created as an executable with the same entry point as the primary assembly. Also, if the primary assembly has a strong name, and a .snk file is provided, then the target assembly is re-signed with the specified key so that it also has a strong name.


ILMerge is packaged as a console application. But all of its functionality is also available programmatically.


There are several options that control the behavior of ILMerge. See the documentation that comes with the tool for details.


ILMerge runs in the v2.0 .NET Runtime, but it is also able to merge v1 or v1.1 assemblies. However it can merge PDB files only for v2 assemblies.


Currently, ILMerge works only on Windows-based platforms. It does not yet support Rotor or Mono.


If you have any problems using ILMerge please contact mbarnett _at_ microsoft _dot_ com. More details are available at the ILMerge web site.
Download ILMerge.Msi

Monday, October 12, 2009

Private Assembly

Private Assembly:
  • It is available and accessible with in an application
  • It will reside inside the application folder
  • It is designed only for isolated application
  • By default, all the assemblies are private assemblies.
  • Private assembly must be accompanied by an assembly manifest.
  • Private assemblies are not required to be installed
  • It is not required to be signed, and PublicKeyToken is not required in the element of the assembly manifest.

What is Assembly

Assembly is a compiled code which is also called as native code and it will be compatible to run on operating system. It may be either executable or library file (.dll).

An Assembly is a reusable, versionable, self-describing deployment unit for types and resources. It is the primary building block of .NET Applications.

Assembly consist of following logical components
  1. Manifest
  2. Metadata
  3. Resources

Assemblies are classified into 3 categories, there are

  1. Private
  2. Public or shared
  3. Satellite