Comments (5)
I see that this issue is still open. Where would you suggest I go reading to get my head around this issue?
from ilpack.
@luhis Thanks a lot for your feedback. You have the SandboxSubject.csproj
in the solution that let you test a target of your choice, for example an executable. Don't hesitate to submit if PR if you can. We don't have resources for this project right now, but any help is highly appreciated.
from ilpack.
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 .entrypoint
is being added to the constructor, not the actual entrypoint.
.class private auto ansi Program
extends [System.Private.CoreLib]System.Object
{
// Methods
.method public specialname rtspecialname
instance void .ctor () cil managed
{
// Method begins at RVA 0x2050
// Code size 7 (0x7)
.maxstack 8
.entrypoint
IL_0000: ldarg.0
IL_0001: call instance void [System.Private.CoreLib]System.Object::.ctor()
IL_0006: ret
} // end of method Program::.ctor
.method public static
void Main () cil managed
{
// Method begins at RVA 0x2058
// Code size 11 (0xb)
.maxstack 8
IL_0000: ldstr "Hello World!"
IL_0005: call void [System.Console]System.Console::WriteLine(string)
IL_000a: ret
} // end of method Program::Main
} // end of class Program
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.
from ilpack.
@jwhitehorn While defining the entry point, we need a method handle. I think you use ctor
's handle by mistake (or more likely you use a constant method handle that's coincidently resolved to the ctor
handle at the method serializing step due to its serialization order). My initial post describes more about the problem that I described in the code comments. The most important part is:
The main reason was we need to know entry-point method handle ahead of its serialization to able to serialize type as first type in the assembly.
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 🙂
from ilpack.
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+?
from ilpack.
Related Issues (20)
- Generated assembly from a .NET 5 executable is ".NETFramework" instead of ".NETCore" HOT 2
- (with patch) Functions with 'void*' in params list HOT 3
- (with proposed patch), null dereference in TryGetRawMetadata after removed null check HOT 1
- Exported Net core lib is referencing System.Private.CorLib instead of System.Runtime HOT 8
- some proposal for perfomance opt (small patch)
- With Patch/Fix: Missing Generic Type arguments in OpCodes.Call(x) HOT 1
- Lokad.ILPack does not have a strong name
- Saved Dynamic Assembly Not showing in VS intellisense but ILSpy and VS Object Explorer Look correct HOT 2
- Unable to translate FieldBuilders with no declaring type HOT 6
- Unable to look up MethodDefinition for constructed generic method
- Fail to export referenced types in `System.Private.CoreLib` due to `DefaultInterpolatedStringHandler` HOT 4
- Type names containing special characters HOT 2
- Migration to .NET 6.0 causes test suite to hang HOT 1
- DeclareInterfacesAndCreateInterfaceMap conundrum HOT 8
- Support function pointers as arguments of function pointers
- Partially defined generic methods are not working
- Add equivalent of AssemblyBuilder.SetEntryPoint HOT 10
- Classes that implement interfaces with defaulted methods crash the dll generator. HOT 2
- Unexpected InvalidOperationException with .NET 8.0
- AssemblyGenerator fails when generating bytes for 'System.Private.CoreLib' in .NET 8.0 HOT 1
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 ilpack.