OK first let’s try to understand what the interviewer is talking about. Let’s say you have made an application and its using a DLL which is present in GAC. Now for some reason you make second version of the same DLL and put it in GAC. Now which DLL does the application refer? Ok by default it always uses the version by which you have compiled you application in IDE. But you want that it should actually use the older version.
So first we answer in short. You need to specify “bindingRedirect” in your config file. For instance in the below case “ClassLibraryVersion” has two versions “1.1.1830.10493” and “1.0.1830.10461” from
Showing posts with label Assembly. Show all posts
Showing posts with label Assembly. Show all posts
Monday, 7 November 2011
Sunday, 23 October 2011
What is Delay signing ?
During development process you will need strong name keys to be exposed to developer which is not a good practice from security aspect point of view.In such situations you can assign the key later on and during development you can use delay signing
Following is process to delay sign an assembly:
Following is process to delay sign an assembly:
- First obtain your string name keys using SN.EXE.
- Annotate the source code for the assembly with two custom attributes from System.Reflection: AssemblyKeyFileAttribute, which passes the name of the file
How to add and remove an assembly from GAC?
There are two ways to install .NET assembly in GAC:-
- Using Microsoft Installer Package. You can get download of installer from http://www.microsoft.com.
- Using Gacutil. Goto “Visual Studio Command Prompt” and type “gacutil –i (assembly_name)”, where (assembly_name) is the DLL name of the project.
What is the concept of strong names?
How do we generate strong names ?
What is the use of SN.EXE ?
How do we apply strong names to assembly?
How do you sign an assembly?
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
What is the use of SN.EXE ?
How do we apply strong names to assembly?
How do you sign an assembly?
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
Friday, 21 October 2011
Is versioning applicable to private assemblies?
Versioning concept is only applicable to global assembly cache (GAC) as private assembly lie in their individual folders.
Thursday, 20 October 2011
If you want to view a Assembly how do you go about it ?
What is ILDASM ?
When it comes to understanding of internals nothing can beat ILDASM. ILDASM basically converts the whole exe or dll in to IL code. To run ILDASM you have to go to "C:\Program Files\MicrosoftVisual Studio .NET 2008\SDK\v1.1\Bin". Note that i had v1.1 you have to probably change it depending on the type of framework version you have.
If you run IDASM.EXE from the path you will be popped with the IDASM exe program as shown in figure ILDASM. Click on file and
When it comes to understanding of internals nothing can beat ILDASM. ILDASM basically converts the whole exe or dll in to IL code. To run ILDASM you have to go to "C:\Program Files\MicrosoftVisual Studio .NET 2008\SDK\v1.1\Bin". Note that i had v1.1 you have to probably change it depending on the type of framework version you have.
If you run IDASM.EXE from the path you will be popped with the IDASM exe program as shown in figure ILDASM. Click on file and
What is Difference between NameSpace and Assembly?
Following are the differences between namespace and assembly :
- Assembly is physical grouping of logical units. Namespace logically groups classes.
- Namespace can span multiple assembly.
What are the different types of Assembly in .Net?
There are two types of assembly Private and Public assembly. A private assembly is normally used by a single application, and is stored in the application's directory, or a sub-directory beneath. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Shared assemblies are usually libraries of code which many applications will find useful, e.g. Crystal report classes which will be used by all application for Reports.
Wednesday, 19 October 2011
What is a Assembly in .Net?
- Assembly is unit of deployment like EXE or a DLL.
- An assembly consists of one or more files (dlls, exe’s, html files etc.), and represents a group of resources, type definitions, and implementations of those types. An assembly may also contain references to other assemblies. These resources, types and references are described in a block of data called a manifest. The manifest is part of the assembly, thus making the assembly self-describing.
- An assembly is completely self-describing.An assembly
Subscribe to:
Posts (Atom)