GithubHelp home page GithubHelp logo

Comments (12)

gluck avatar gluck commented on July 24, 2024

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.

trullock avatar trullock commented on July 24, 2024

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.

trullock avatar trullock commented on July 24, 2024

Here is a package that should get the ball rolling

http://cl.ly/IFVX

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.

gluck avatar gluck commented on July 24, 2024

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.

trullock avatar trullock commented on July 24, 2024

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.

peters avatar peters commented on July 24, 2024

This could easily be integrated into https://github.com/peters/ILRepack.MSBuild.Task. A pull request would be most welcome @trullock :)

from il-repack.

trullock avatar trullock commented on July 24, 2024

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.

gluck avatar gluck commented on July 24, 2024

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.

CumpsD avatar CumpsD commented on July 24, 2024

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.

gluck avatar gluck commented on July 24, 2024

@CumpsD AFAIK it should work, feel free to raise any issue with it

from il-repack.

trullock avatar trullock commented on July 24, 2024

Hmm I've got an issue with this. If i try and ILRepack two assemblies with resources at the same id/address, ILrepack WARNs 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.

trullock avatar trullock commented on July 24, 2024

OK i've got repro assemblies. Can I email you? would prefer not to publicaly post them

from il-repack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.