473,498 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with merging assemblies using ILmerge

26 New Member
Hello,

I have used ILMerge tool to merge the multiple dlls into one. The dlls were merged successfully and the out file was also dll.
But when i am using this dll with other application, it is giving me error with Resources.

The resources are there in same assembly, with build action None.

Like :
The resource file is Expression.xml in Resources folder with build action None.
Then after merging the dlls, with new dll I am getting exception with the line
TextReader reader = new StringReader(Properties.Resources.Expression);

So the application is not able to find the resource Expression, but if I check the dll in the Reflector, the resource is there.

Can anyone tell me what to do with this problem?

Regards
Abhishek
Feb 11 '09 #1
1 3720
kulabhishek
26 New Member
Actually problem is, the application using the merged dll is not able to find the resources inside merged DLLs.

Let me explain the problem with the help of a demo project.

Here is what I have done in demo project

Inside one solution, I have 4 projects.

Project 1: DLL with name A.B.C.Resources1.dll and namespace A.B.C
Project 2: DLL with name A.B.C.Resources2.dll and namespace A.B.C
Project 3: DLL with name A.B.D.Resources3.dll and namespace A.B.D
Project 4: EXE with name X.Y.Z.ResourcesTest.exe and namespace X.Y.Z . This project has the above three projects added as
references.

Each of the first three projects contains :
A. Image resource (The resources are added the way you told).
B. One form and one button added to it.

I am simply setting the image for the button inside constructor of each project, as :

Button_Name.Image = Properties.Resources.Image_Name;

The fourth project has three buttons, each for one DLL and I am calling appropriate constructor on button click event.

Now, if i use three DLLs separately : everything works fine.

If I merge three dlls with command :

ILMerge /log:A.B.C.Resources.log /t:library /copyattrs /allowdup /out:A.B.C.Resources.dll A.B.C.Resources1.dll A.B.C.Resources2.dll A.B.D.Resources3.dll

and

use the merged DLL in the 4th project : The image for button of the 2nd DLL is not visible (Resources not found).

Observations and Findings :

1. After merging, the Resource class is getting renamed by the ILMerge for the 2nd DLL. This happens because the namespace of
the first and second DLL is the same.

Ex : I saw the merged DLL inside Reflector, It shows, inside namespace A.B.C.Properties,
Class Resources for the A.B.C.Resources1.dll DLL is as it is : Resources
Class Resources for the A.B.C.Resources2.dll DLL is renamed to A.B.C.Resources23043.Resources

2. For the 3rd DLL everything works fine, as it has different namespace.

3. If I change the namespace for the 3rd DLL to A.B.C and merge the DLLs, the image for buttons of the 2nd as well as 3rd DLLs are
missing.

4. If I use the different namespace for each DLL and merge them and use, everything works fine.

5. So, basically I think this is due to renaming of the Resource class in the A.B.C.Properties namespace.

Is there any way to solve this, without changing the namespaces?? Because I want all the dlls to have the same namespace.

Is there any way to stop renaming by ILMerge?

Regards
Abhishek
Feb 18 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2628
by: thechaosengine | last post by:
Hi, I have a solution made out of about 5 projects. At the moment, each one is creating its own dll in its own subdirectory. I seem to remember that there is a way to merge multiple dlls into...
3
995
by: Tim Marsden | last post by:
Hi, I am trying to use ILMerge to consolidate a .exe and serval .dll's into a single .exe. (VB.NET) I am using the following command. ILMerge.exe /wildcards /log:Log.txt...
3
6015
by: John R. | last post by:
I have an application written in C# and i am using MS XML DOM! I have a document with the following structure (only the <DicEntry> - Elements are important): <NewDataSet...
4
1621
by: Wayne P. | last post by:
I'd like to embed some dependent assemblies in my exe as not to worry about distribution. I have come across a few examples in C# (http://weblogs.asp.net/jdennany/archive/2003/09/24/29035.aspx),...
2
1721
by: Stefan | last post by:
Hi there! I'm very new to XML and XSLT, so while working i encountered the following, probably very easy to solve, problem. i've got 2 XML-files, which look like this: LinesOfCode.xml:...
7
2180
by: Khaled Hussein | last post by:
Hi Every body, I am currently working in aproject where I am stuck in merging an ActiveX control (*.ocx) file into a managed Class Library (*.dll). I want to hide the ActiveX Control in this...
0
1227
vikramadith
by: vikramadith | last post by:
I'm having some issues merging dlls into my exe Basically I have three VS projects, one producing an exe, and the other two producing dlls. Let us just call it MyApp.exe, Lib1.dll and Lib2.dll....
5
2782
by: =?Utf-8?B?aWduaGVucnk=?= | last post by:
I have a managed C++ project and two C# projects. All are class library projects. The C++ project links with native C++ static libraries and references to one C# project. The projects structure...
1
1256
by: kulabhishek | last post by:
Hi, I am using ILMerge tool to merge the all the dlls into one. In my case I do not want to include one dll into output one. But my other dlls are using the reference of that dll. How it can be...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6885
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
7379
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...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.