-
-
Notifications
You must be signed in to change notification settings - Fork 638
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
TypeSystem.Object brings mscorlib assembly reference on .NET Core #524
Comments
Cecil's TypeSystem type will try to find a «core library» in your module to use (with mscorlib or System.Private.CoreLib being such a library), and if it doesn't find one it will create a reference to mscorlib. Before adding a type, is there an existing reference to mscorlib in your dll? Cecil will pick a mscorlib over a System.Private.Corelib. |
It's all in there: https://github.com/jbevain/cecil/blob/master/Mono.Cecil/TypeSystem.cs |
@jbevain I see where
If I remove this, I will end up with only |
You can use |
I'm on
netcoreapp2.0
withMono.Cecil 0.10.0
and noticed that the given line of codenew TypeDefinition(assemblyName, "Main", TypeAttributes.Class | TypeAttributes.Public, module.TypeSystem.Object);
produces following IL:
.class public auto ansi Main extends [mscorlib]System.Object
with these assembly references:
but AFAIK
mscorlib
stands for full framework and since im on .NET Core I expect it to be eitherSystem.Private.CoreLib
orSystem.Runtime
only. I assume thatMono.Cecil
resolvesTypeSystem.Object
tomscorlib
somewhere in the code implicitly despite the selected platform.Am I getting it right? If so, please push me in the right direction on how to explicitly route everything to
System.Private.CoreLib
. Otherwise, please explain the idea.The text was updated successfully, but these errors were encountered: