Comments (12)
I'm willing to help, but I'm very much a stranger to Asp.Net stuff.
Could you provide test assemblies I could use and try to merge ?
At first sight, the hacks performed by aspnet_merge include (and probably needed in ILRepack to work properly):
A. Win32Resource lookup (the one you're refering to)
This code is accessing a Win32Resource within the assembly.
WebILMerge merges (binary concat) all Win32Resources of some type (id = 0x65, type = 0xebb) into one, remember the offset diff, and adds it up to all calls to CreateResourceBasedLiteralControl (first arg) and WriteUTF8ResourceString (second arg).
B. FastObjectFactory types merging
All classes that start with this name will be merged into one class called:
"FastObjectFactory_" + OutputAssemblyName.ToLowerInvariant().Replace('.', '_')
All implemented interfaces are merged, all members are merged, only the first initializer is kept, only the first implementation of GetEngine/SetEngine methods is kept.
C. Fixing of web source files (*.aspx, *.ascx, *.master)
Replacing "App_Web_..." by the new assembly name.
Some some stuff (SimpleParser)
And maybe more.
A & B may be feasible, and could be enough for some merging options (-w or -o).
Can you provide a sample (already compiled, with Win32 resources) site + merge command you'd like to mimic ?
from il-repack.
Initially, all I'm interested in is A, but I think it could be a worthwhile project for the community to support B and C also.
I'm putting a project together now that features all the aspects of compiler trickery
from il-repack.
Here is a package that should get the ball rolling
src is the source,
published is a standard publish from VS
compiled has been aspnet_compiler'd
aspnet_merged is what we're trying to replicate, specifically Views.dll
from il-repack.
I commited experimental support for Win32Resource merging and asp resource hacking.
You can either build it yourself, or try the binaries here: http://cl.ly/180G3f3d272d
Let me know how it behaves.
from il-repack.
This almost works, great job man!
I think this is worthy of being a core feature if its stable (i'll keep investigating) although the behaviour should probably be controlled with a switch.
one problem is that it needs to update the .compiled
files (see the aspnet_merged\bin
) folder in my example. There's an assembly
attribute in there that needs updating to the output dll. Ive changed this manually and it seems to work, although i dont know what the filehash
attribute is....
The merged source dlls also need deleting, so if this is to become a full feature it might be worth having ilrepack do it for you
from il-repack.
This could easily be integrated into https://github.com/peters/ILRepack.MSBuild.Task. A pull request would be most welcome @trullock :)
from il-repack.
It could, although I don't like the idea of it doing half a job, with the whole job being scattered across multiple places. ILRepack should finish the job. I will try and get round to looking at this soon. @gluck where can I find the source? I cant see a branch for it
from il-repack.
Everything's been pushed to master, and is now the default behavior.
Look here for the argument fix:
https://github.com/gluck/il-repack/blob/master/ILRepack/ILRepack.cs#L1810
And here for the win32 resource concat:
https://github.com/gluck/il-repack/blob/master/ILRepack/ILRepack.cs#L810
from il-repack.
Just checking up on the state of this, can ILRepack be used to package up an entire ASP.NET site into 1 assembly? Or is this not yet possible (as I understand from reading this issue)
Basically removing any need for aspnet_compiler + aspnet_merge + ilmerge
from il-repack.
@CumpsD AFAIK it should work, feel free to raise any issue with it
from il-repack.
Hmm I've got an issue with this. If i try and ILRepack two assemblies with resources at the same id/address, ILrepack WARN
s and ignores, whereas it needs to include all the resources and modify any references in the same way aspnet_merge does. I'll try and provide repro binaries asap
from il-repack.
OK i've got repro assemblies. Can I email you? would prefer not to publicaly post them
from il-repack.
Related Issues (20)
- Does IL Repack remove unused members? HOT 3
- ILRepack build fail on JetBrains Rider HOT 1
- Include/Exclude Predicate for the "NuGet API" HOT 2
- Method reference is used with definition return type / parameter.
- SourceLink is not working when ILRepack is used.
- IL-repack fails when merging assemblies with netmodules
- Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly HOT 2
- Failed to resolve assembly: 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' HOT 1
- can i be new maintainer HOT 6
- No logging when using ILRepack programmatically
- More granular Internalize excluding HOT 2
- Option to remove all non-referenced members from output assembly HOT 6
- Merge success reported, but assemblies not merged in publish folder HOT 3
- Module initializers are DuplicateIgnored away
- Can't add Microsoft.VisualStudio.LanguageServer.Protocol.dll (from NuGet) HOT 3
- Is this project abandoned? If so, what are the alternatives? HOT 5
- ConfigMerger loses the default value
- InvalidCastException when trying to merge Oracle.ManagedDataAccess.dll
- ReferenceFixator fails to fix MethodReference if the method is defined on the base class. HOT 2
- Specified method is not supported. #900 HOT 3
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.