Skip to content
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

System.Reflection.Emit.DynamicILInfo #18703

Closed
dudikeleti opened this issue Sep 25, 2016 · 12 comments
Closed

System.Reflection.Emit.DynamicILInfo #18703

dudikeleti opened this issue Sep 25, 2016 · 12 comments
Assignees
Labels
area-System.Reflection.Emit enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@dudikeleti
Copy link

I rely in my code on this type. Is it planned to include it? Currently in .NET API Catalog it's not seem to exist in .NET Standard or .NET Core App.

Search for this in this repository does not give any hint.

  • (Same issue with System.Reflection.MethodBody and Resolve methods on Module type, but I see they are include in .NET Standard 2.0)
@karelz
Copy link
Member

karelz commented Sep 26, 2016

@weshaggard @danmosemsft can you provide details here?

@danmoseley
Copy link
Member

We aren't planning to add Reflection.Emit to .NET Core at this time.

@dudikeleti
Copy link
Author

@danmosemsft But there is others Reflection.Emit types that exist. DynamicMethod for example exist in System.Reflection.Emit.Lightweight assembly.

@weshaggard
Copy link
Member

There is some basic support for Reflection.Emit in .NET Core today. We don't currently have plans to add any further support at this point, that may change in the future.

I don't know enough about the space to provide information about DynamicILInfo, but perhaps @jkotas can help suggest some other possible ways to handle that.

@jkotas
Copy link
Member

jkotas commented Sep 27, 2016

What are you using DynamicILInfo for?

@dudikeleti
Copy link
Author

dudikeleti commented Sep 27, 2016

@jkotas I'm using it for set the byte array code of a DynamicMethod (I need to convert method to DynamicMethod).

As an aside, why DynamicMethod and emit opcodes are included and DynamicILInfo not? Is it not just more form the same capabilities? There is something special that it can't be included?
If not, it would be nice if it included.

BTW @terrajobst wrote in this post:

Reflection Emit. Reflection emit is reasonably self-contained and thus we plan on following the model as Registry, above. There are other APIs that logically depend on being able to emit code, such as the expression tree’s Compile method or the ability to compile regexes. In some cases we’ll emulate their behavior (e.g. interpreting expression trees instead of compiling them) while in other cases we’ll throw (e.g. when compiling regexes).

I wonder if its including DynamicILInfo also.

@jkotas
Copy link
Member

jkotas commented Sep 27, 2016

There is no reasonable way in the currently available .NET Core RefEmit APIs to just set the IL for the method if you have it available. I agree that it would make sense to add DynamicILInfo. It is the core building block for power users - ILGenerator and friends are a convenience layer above it.

@karelz
Copy link
Member

karelz commented Feb 28, 2017

Next step: Design it and implement it. Potentially leverage Desktop code (it is also on ReferenceSource).

@jkotas
Copy link
Member

jkotas commented Feb 28, 2017

Next step: Design it and implement it. Potentially leverage Desktop code

This code is in CoreCLR (https://github.com/dotnet/coreclr/blob/68f72dd2587c3365a9fe74d1991f93612c3bc62a/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs#L925). It needs to be flipped back to public, exposed in contracts, and tests added.

@karelz
Copy link
Member

karelz commented Mar 1, 2017

Even better, marking as "up for grabs". Anyone interested?

@ghost ghost self-assigned this Jun 27, 2018
@ghost ghost assigned ghost and unassigned ghost Jul 11, 2018
@ghost ghost removed their assignment Sep 12, 2018
@stephentoub
Copy link
Member

It needs to be flipped back to public, exposed in contracts, and tests added.

In addition, the code in coreclr is missing a bunch of its members... those will need to be ported back from netfx as well, though it shouldn't be much more than copy/paste.

@maryamariyan
Copy link
Member

Closed by dotnet/corefx#34532

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 3.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Reflection.Emit enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

8 participants