-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support entry-point method and executable assemblies #37
Comments
I see that this issue is still open. Where would you suggest I go reading to get my head around this issue? |
@luhis Thanks a lot for your feedback. You have the |
This would be a very useful feature to have. I just started taking a shot at it, and have made a little progress. Unfortunately the
I suspect this has something to do with @osman-turan 's comment: "...we need to serialize entry point without serializing any type definition." I'm afraid I'm not certain what that implies - this is a little new to me. Any clarification or elaboration would be greatly appreciated. |
@jwhitehorn While defining the entry point, we need a method handle. I think you use
So we need to "reserve" a method handle for entry-point "without" actually serializing the method (otherwise .NET Core will complain). Then we should feed this reserved handle to the entry-point definition. And finally, we can serialize the entry-point method handle with the previously reserved method handle. I hope, it's a bit more clear now 🙂 |
…works fine for .NET 3.1 and later.
Hi folks! Great library. I'm trying to figure out how to set the entry point of an AssemblyBuilder instance. Is it possible with .NET Core/5+? |
Initial code had some problems to support executable assemblies (e.g. console applications). The main reason was we need to know entry-point method handle ahead of its serialization to able to serialize
<Module>
type as first type in the assembly. See:ILPack/src/AssemblyGenerator.cs
Lines 43 to 58 in d02493d
With #31, we could reserve metadata tokens prior to serialization. So, this could help us to support executable assemblies.
The text was updated successfully, but these errors were encountered: