I'm trying to make a .NET Core shared library. I used the Class Library (package)
project template in VS 2015. My library needs to use a couple reflection mechanisms I am familiar with from the full .net 4 framework, but I don't now how to access these in a .NET Core library. Specifically:
- The
Delegate
type has aMethod
property that returns aMethodInfo
object. - The
Type
class has aBaseType
property,FilterName
property,InvokeMember
method andFindMembers
method I can't reach in .NET Core.
I added NuGet packages that allegedly have the reflection pieces I need:
"frameworks": {
"net451": {
"dependencies": {
"System.Reflection": "4.1.0-beta-23516",
"System.Reflection.Extensions": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
}
},
"dotnet5.4": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.Reflection.Extensions": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Runtime": "4.0.21-beta-23516",
"System.Threading": "4.0.11-beta-23516"
}
}
},
"dependencies": {
"System.Reflection.TypeExtensions": "4.1.0-beta-23516"
}
I've also added using System.Reflection
, but I still am getting errors that indicate that these properties and types are undefined.
What am I doing wrong?
Aucun commentaire:
Enregistrer un commentaire