In a .NET Core class library project that targets both net452 and netstandard1.3 , I try to move the latter back to netstandard1.2 to expand backward compatibility.
Project uses the BindingFlags enum and builds fine on net452 as well as netstandard1.3, but it fails on netstandard1.2 with a number of errors, everything looks like:
CS0103 The name "BindingFlags" does not exist in the current context
or how:
CS7069 A reference to the type "BindingFlags" claims to be defined in "System.Reflection", but could not be found
Currently, the frameworks attribute in the project.json file:
"frameworks": { "netstandard1.2": { "imports": [ "dnxcore50", ], "dependencies": { "NETStandard.Library": "1.6.0", "runtime.any.System.Collections": "4.0.11", "System.Collections": "4.0.11", "System.Collections.NonGeneric": "4.0.1", "System.Console": "4.0.0", "System.IO.FileSystem": "4.0.1", "System.Reflection.TypeExtensions": "4.1.0", "System.Runtime.Serialization.Xml": "4.1.1", "System.Text.Encodings.Web": "4.0.0" } }, "net452": { "frameworkAssemblies": { "System.IO": "", "System.Runtime.Serialization.Xml": "", "System.Xml": "", "System.Web": "" } } },
and it already lists the dependency on System.Reflection.TypeExtensions .
Show potential fixes popup suggests setting "System.Reflection": "4.3.0-preview1-24530-04" , only to find that this type is still displayed with a red squiggly line. Another pop-up pop-up pop-up screen a second time suggests setting "System.Reflection.TypeExtensions": "4.3.0-preview1-24530-04" . Of course, without affecting the error that is still there.
The net452 line is going well, only errors on the netstandard1.2 build.
What is wrong with this type of BindingFlags ?