Showing posts with label dll. Show all posts
Showing posts with label dll. Show all posts

Friday, September 24, 2010

Microsoft.Web.GeneratedImage.dll

The GeneratedImage control is a combination of an ASP.NET Web Control and a set of classes that facilitate programmatically creating, serving, caching, and transforming images. If you store images in the database that need to be served from a web page, if you need to create images on the fly, or if you need to resize, add watermarks, or perform some other image transform, then the GeneratedImage control can help.

This article looks at using the GeneratedImage control. Specifically, we'll see how to generate dynamic images on the fly based on a variety of inputs.

Sunday, August 8, 2010

Referencing an Assembly from Global Assembly Cache

In order to reference an seeembly from GAC. We have to have an assembly with a strong name, in case the assembly is not a strong named then you have to created a strong name for that assembly. follow this article for reference
http://www.kivela.be/index.php/2007/12/11/strong-signing-a-third-party-assembly-in-net/

After the strong name is assigned for any dll. If you try to reference any DLL at that point its reference is checked from GAC as per strong name or publick key token. If the strong name is matched with the SN for the DLL you are referenceing then you don't see the assemble in the bin of your project directory. else the DLL will be added to you BIN directory.

To add a reference

•In Solution Explorer, expand the project node to which a reference is to be added.
•Right-click the References node for the project and select Add Reference from the shortcut menu.
•To add a reference to a component or components, do the following:
•In the Add Reference dialog box, select the tab indicating the type of component to be referenced.
•In the top pane, select the component to be referenced, and then click the Select button.
Tip If the component you are looking for is not in the list, you may locate it using the Browse button.

The component referenced appears in the SelectedComponents pane of the dialog box.

•Repeat Step b for each additional component added.
•Click OK when references are all added.

To add assemblies to the Add References dialog box

•In Windows, click the Start button, click Run, then type regedit, to open the Registry Editor.
•Select the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\AssemblyFolders
•On the Edit menu, point to New, then, click Key.
•Enter a name for the key (for example, MyAssemblies).
•Select the (Default) value for the key that you just added.
•On the Edit menu, choose Modify.
•In the Edit String dialog box, select the Value data field and enter the full path to the folder where your assemblies are located.

To remove a reference

•In Solution Explorer, right-click the reference in the References node, and select Remove from the shortcut menu.
•By default, the Add References dialog box only lists assemblies that are in the Public Assemblies folder (Program Files\Microsoft Visual Studio .NET\Common7\IDE\Public Assemblies) or in the Global Assembly cache. You can add your own assemblies to the list by adding a registry key to specify their location

Strong signing a third party assembly in .net.?

Assigning a strong name to a third party DLL using your visual studio command prompt.

E.g.
Lets say the name of the third party DLL is myTest.dll.

Step 1: Dis-assemble the assembly, as we have to asign the strong name for DLL
ildasm myTest.dll /out:myTest.il


Create a Strong Name:
sn -k myTest.snk


Step 2: Re-Assemble using your strong-name key
ilasm myTest.il /res:myTest.res /dll /key:myTest.snk /out:myTestSN.dll

for verification you can use following command,
sn -vf myTestSN.dll