473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Article : Assembly Linker (Al.exe .Net FrameWork Tools Series)

Hi All,

Assembly linker is a tool which is used to create an assembly by combining
one or more .netmodules and resource files.

In simple words an .netmodule is an IL file that does not have manifest in
it .... you can say its an assembly without the manifest ... and hence a
non -assembly file containing IL code.

In the yesterday's example we saw how we can create the .resources file
which by itself is a binary file containing your resource data. Today we
will see how we can embed or link this .resource file with other .netmodules
and create an assembly

1) Create 2 .netmodules say Module1.netmodule and Module2.netmodule
2) Create a .resources file say MyResources.resources (as we created in
yesterdays article ... please to the same for more details)
3) Now type the follwoing command to combine these modules and binary
resource file into a single assembly.

// to create a dll.
al Module1.netmodule Module2.netmodule /embed:MyResources.resources
/out:MyExecutable.dll

// to create an exe.

al Module1.netmodule Module2.netmodule /embed:MyResources.resources
/out:MyExecutable.exe /target:exe /Main:Class1.Main
If you dont want to embed the resource file then use the /link option
instead of /embed option with al.exe.

Well if you have an want to embed or link a resource then you can compile
the resource file when you are compliing the assembly with csc.exe or
vbc.exe just use /resource to embed the resource or /linkresource with the
assembly.

You can also achieve this from VS.Net studio by including the resource file
in the project and setting the Build Action of the resource type to Embedded
Resource.

Al is mainly used by a lot of developers to create resource satellite
assemblies esp for creating multilingual applications by creating resource
assemblies for various cultures.

If only resource files are passed to Al.exe, the output file is a satellite
resource assembly.

E.g. To create an satellite assembly for french culture

1) Create a file named MyResource.fr-FR.txt
2) Type your name=value resource data in it to generate the resource file
3) generate the resource file with the name of MyResource.fr-FR.resources.
4) And finally create the satellite assembly as shown below for your
application

al /out:MyGlobApp.resources.dll /v:1.0.0.0/c:fr-FR
/embed:MyResource.fr-FR.resources, Private

Note : Check out the Private keyword in the above command. You can use the
"private" option if you want dont want other assemblies to use the embedded
resource files by default it is "public".

5) In this command we have specified the output file name , the version of
this DLL , the culture "fr-FR" which denotes french and finally we are
embedding the fr-FR.resources file in MyGlobApp.resources.dll

6) Place this file in bin\fr-FR folder of your application and read it from
the application using the ResourceManger Class.

There are a lot of other options that are available with AL you can view
these options by typing al /? or al /help. I am enlisting a few important or
frequently used ones here :
a.. /copy[right]:<text> Copyright message
b.. /c[ulture]:<text> Supported culture
c.. /delay[sign][+|-] Delay sign this assembly
d.. /out:<filename> Output file name for the assembly
manifest
e.. /t[arget]:lib[rary] Create a library
f.. /t[arget]:exe Create a console executable
g.. /t[arget]:win[exe] Create a Windows executable
h.. /trade[mark]:<text> Trademark message
i.. /v[ersion]:<version> Version (use * to auto-generate remaining
numbers)
j.. /win32icon:<filename> Use this icon for the output
k.. /win32res:<filename> Specifies the Win32 resource file

If you checkout the help at the end you will see this lines which show you
how to go about using this tool.

Sources: (at least one source input is required) <filename>[,<targetfile>]
add file to assembly

/embed[resource]:<filename>[,<name>[,Private]]
embed the file as a resource in the assembly

/link[resource]:<filename>[,<name>[,<targetfile>[,Private]]]
link the file as a resource to the assembly

-- Please post your queries and comments for my articles in the usergroup
for the benefit of all. I hope this step from my end is helpful to all of
us.

Regards,

Namratha (Nasha)

Nov 16 '05 #1
0 5510

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Nau | last post by:
I've been trying to get a concrete answer to this for the last few days, but have come up short. I'm hoping someone here can help. Is there a way to take a set of c# modules (c# code compiled...
1
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Before we start with our sample app we need to view the security configuration files on the machine. You will find them under <drive>\WInNT\Microsoft.NET\FrameWork\<version>\Config ...
1
by: Namratha Shah \(Nasha\) | last post by:
Hi All, This is a resource file generation tool which converts an xml based resource formats to .net resource file i.e. (.resources) and vice-versa. Today we will see how we will generate ...
0
by: Namratha Shah \(Nasha\) | last post by:
Type Library Importer : tlbImp This tool is used to convert the type library definitons found in COM components to .NET assembly. This tool works on the entire type library at the same time...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, TlbExp.exe and Regasm.exe tools aid us in exporting assembly information to a type library so that non .Net Applications or unmanaged code use this type library information to call...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Group, After a long week end I am back again. Its nice and refreshing after a short vacation so lets get started with .NET once again. Today we will discuss about Isolated Storage. This is...
2
by: George Durzi | last post by:
I'm trying to put an assembly into the GAC. The assembly is called Common.Mail. I've done the following: - Create a strong name for Common.Mail: - From command prompt: cd Program...
0
by: Namratha Shah \(Nasha\) | last post by:
Hi All, Assembly linker is a tool which is used to create an assembly by combining one or more .netmodules and resource files. In simple words an .netmodule is an IL file that does not have ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.