Comments (16)
Both your assemblies are already ILMerg'ed with Newtonsoft.Json (meaning they both define the types, as internal, you can see them using ildasm or reflector or ilspy...).
If you're lucky enough that the same version was used in both cases, try IL Repack with /union.
Let me know if it works.
from il-repack.
I'm using union already. :(
I hadn't noticed Magnum was using Newton as well.
Is there any way around it?
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 09 July 2012 14:31
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
Both your assemblies are already ILMerg'ed with Newtonsoft.Json (meaning they both define the types, as internal, you can see them using ildasm or reflector or ilspy...).
If you're lucky enough that the same version was used in both cases, try IL Repack with /union.
Let me know if it works.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
The should both be the same version
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 09 July 2012 14:31
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
Both your assemblies are already ILMerg'ed with Newtonsoft.Json (meaning they both define the types, as internal, you can see them using ildasm or reflector or ilspy...).
If you're lucky enough that the same version was used in both cases, try IL Repack with /union.
Let me know if it works.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
I checked the code and /union is ignored if the types are internal, it prefers renaming the types (may not be the best choice).
If you feel adventurous, you may try hacking around ILRepack.cs:1370 to change that.
Otherwise I'll try the merge and see:
- why the renaming doesn't work (likely some reference was missed during the rename process)
- if we could check /union and/or dupTypes BEFORE renaming, even for internal types
Thx.
from il-repack.
Thanks, I changed that line to read
else if (type.FullName != "" && !type.IsPublic && !UnionMerge)
and it is working.
Adam
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 09 July 2012 15:15
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
I checked the code and /union is ignored if the types are internal, it prefers renaming the types (may not be the best choice).
If you feel adventurous, you may try hacking around ILRepack.cs:1370 to change that.
Otherwise I'll try the merge and see:
- why the renaming doesn't work (likely some reference was missed during the rename process) 2. if we could check /union and/or dupTypes BEFORE renaming, even for internal types
Thx.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
The latest code base (or the way I am building) is causing Reference Resolution errors when I run it. It can't find my assemblies that are not being merged but are in the path specified for lib.
I'm just running the default debug build, should I be doing something different?
I was running 1.0.9 previously.
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 09 July 2012 15:15
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
I checked the code and /union is ignored if the types are internal, it prefers renaming the types (may not be the best choice).
If you feel adventurous, you may try hacking around ILRepack.cs:1370 to change that.
Otherwise I'll try the merge and see:
- why the renaming doesn't work (likely some reference was missed during the rename process) 2. if we could check /union and/or dupTypes BEFORE renaming, even for internal types
Thx.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
It does work if I run it in the same directory as the lib dll's
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 09 July 2012 15:15
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
I checked the code and /union is ignored if the types are internal, it prefers renaming the types (may not be the best choice).
If you feel adventurous, you may try hacking around ILRepack.cs:1370 to change that.
Otherwise I'll try the merge and see:
- why the renaming doesn't work (likely some reference was missed during the rename process) 2. if we could check /union and/or dupTypes BEFORE renaming, even for internal types
Thx.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
Migration to latest Cecil may be causing this, I'll try to have a look as well.
from il-repack.
That change is also affecting anonymous types, it seems to be reusing the one anonymous type across all methods (so the properties donβt match)
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 10 July 2012 03:36
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
Migration to latest Cecil may be causing this, I'll try to have a look as well.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
Ok round 2.
I have removed the old change.
And changed line 93 of ReferenceFixator to
return ((TypeDefinition)type.DeclaringType).NestedTypes.First(x => x.FullName == type.FullName || x.FullName.EndsWith(">" + type.Name));
Not very elegant.
The nested type has a guid it's name but the type.FullName doesn't so it was not being found.
i.e.
ParentType/NestedTypeName vs ParentType/NestedTypeName
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 10 July 2012 03:36
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
Migration to latest Cecil may be causing this, I'll try to have a look as well.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
You can try the latest sources, they should work properly, with either:
/allowdup:Newtonsoft.Json.* (to merge both versions of these types, can be used if they're known to be identical to reduce assembly size)
or no option at all (/union not required, as the conflicting types are internal, they'll be renamed automatically).
Cheers.
from il-repack.
Without the /allowdup (haven't tried it yet)
I get duplicate types in the assembly
Newtonsoft.Json.522512.<>f__Anonymouse Type0'2
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 11 July 2012 13:59
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
You can try the latest sources, they should work properly, with either:
/allowdup:Newtonsoft.Json.* (to merge both versions of these types, can be used if they're known to be identical to reduce assembly size)
or no option at all (/union not required, as the conflicting types are internal, they'll be renamed automatically).
Cheers.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
That was the purpose indeed.
Without merging, Newtonsoft types from Magnum & MassTransit are seen as different types (different assemblies).
By renaming the types, we keep this coherence, and we have them duplicated in the merged assembly (which should still work properly).
If you're certain they're identical and want to avoid those duplicates, /allowdup is what you need.
from il-repack.
But without deduping I thought the renaming would prevent clashes?
I currently have clashes, I cant reflect the new the dll and I get errors about the duplicates when I open the dll in DotPeek (decompiler)
-----Original Message-----
From: Francois Valdy [mailto:[email protected]]
Sent: 13 July 2012 17:11
To: Adam
Subject: Re: [il-repack] Exception when merging Magnum and MassTransit into a new assembly (#10)
That was the purpose indeed.
Without merging, Newtonsoft types from Magnum & MassTransit are seen as different types (different assemblies).
By renaming the types, we keep this coherence, and we have them duplicated in the merged assembly (which should still work properly).
If you're certain they're identical and want to avoid those duplicates, /allowdup is what you need.
Reply to this email directly or view it on GitHub:
#10 (comment)
from il-repack.
And you thought right.
I tested with the latest binary drop of MassTransit and it seemed ok, but maybe I messed up somewhere, will try again.
from il-repack.
The .Net 3.5 version of Magnum gave me a hard time, but it should be good now.
Beware to either use the binary drop of 1.13, or update Cecil fork as well (as some generics-related fixes were there).
from il-repack.
Related Issues (20)
- Properly document all new command line options
- Proposal: Rename /ExcludeInternalizeSerializable to /InternalizeSerializable HOT 1
- Better support for dropping attributes HOT 5
- Add developmentDependency to the nuspec HOT 2
- Error merging VB app in 2.0.27 HOT 20
- Mysterious failure in ILpacked application HOT 10
- Am I misunderstanding ILRepack / ILMerge HOT 11
- Exceptions aren't renamed? HOT 3
- ILRepacked DLL is looking for PDB files in a non-existent subfolder HOT 5
- Ability to internalize a subset of input assemblies HOT 1
- Add an Icon to the nuget package HOT 1
- Repacking Harmony in Debug mode fails HOT 15
- Disable source server warning on unix HOT 2
- Possible Internalize regression HOT 5
- Cecil binaries need to be internalized HOT 7
- Getting "Method reference is used with definition return type / parameter." / Due to TypeForwardedTo type HOT 22
- Replacement for AllowDuplicateType Method of ILMerge HOT 3
- ArgumentOutOfRange in RepackAssemblyResolver.cs:line 203 HOT 2
- TypeReference with null scope
- Metadata warnings in MashupEngine
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from il-repack.