I am migrating a .Net Framework library to .Net standard and the compiler cannot find the core builders from System.Reflection.Emit
.
If I am in the right place then the API documentation states that these builders (MethodBuilder
, ModuleBuilder
and AssemblyBuilder
) are part of System.Reflection.Emit
.
This is the project.json
for my library:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable"
},
"dependencies": {},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
}
}
Do I need any additional reference?
You can find them in "System.Reflection.Emit": "4.3.0"
nugget package for the netstandard1.6 framework.
The "animalito maquina" answer also worked for me but I have investigated the problem a little bit using netstandard2.0. It might not be relevant to this question but I wanted to share this with you since it still might help others :).
I generated two projects(dotnet new):
I added references to AssemblyBuilder class in both projects. The AssemblyBuilder was missing in "classlib" project that has been using netstandard2.0 but was available in "console" project - netcoreapp2.0.
The "problem" is caused by the fact that .NET Core Libraries are actually always a superset of the APIs defined in the corresponding version of the .NET Standard. There are always types and members available in the .NET Core Libraries, which are not (yet?) part of the .NET Standard.
These links might be helpful:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With