Is GetTypeInfo missing in .NETCore 4.5.1?
Asked Answered
H

1

12

I try to read an embedded resource (a font file in a Windows 8.1 Store App) as a Byte stream, but the Problem is the Access to the resource file. I often use

typeof(Type).GetTypeInfo.Assembly.GetMainfestResourceStream(...)

but the method GetTypeInfo() in the System.Reflection.Type of .NETCore v.4.5.1 doesn´t exist. Is a Lib-Reference-missing? I´m a little confused ^^

Hammon answered 12/11, 2014 at 14:43 Comment(3)
It is an extension method, adding using System.Reflection; is required to let the compiler recognize it.Holleyholli
That was too simple ^^Hammon
Please check the answer as accepted :)Ineluctable
I
17

It is an extension method, adding using System.Reflection; is required to let the compiler recognize it.

Thanks to Hans Passant

Ineluctable answered 18/4, 2017 at 20:10 Comment(1)
... and check that your project's <TargetFramework(s)> actually mentions net451 and not e.g. net40. The error message ... (are you missing a using directive or an assembly reference?) in the later case is a bit misleading.Casias

© 2022 - 2024 — McMap. All rights reserved.