Error CS0117: "System.Type" does not contain a definition for "GetTypeCode"

Can someone help me learn to read and navigate msdn documents?

Is this not supported by .net 4.0+?

using System; ... public static bool IsPositive( object Value, bool ZeroIsPositive ) { switch ( Type.GetTypeCode( Value.GetType() ) ) { case TypeCode.SByte: 

It’s very difficult for me to find my way through the documents and find out what specifically relates to Windows Store applications ...

+4
source share
1 answer

Type.GetTypeCode() supported in full-featured .NET applications and non-portable class libraries, but not in Windows Store applications.

If you look at the documentation for Type classes in .NET 4.5 , you will see a green shopping package next to all members that are supported in Windows Store apps.

You can also see the bottom of the page for each individual member. For example, Type.GetArrayRank has the following:

Version Information
.NET Framework
Supported in versions: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Portable class library
Supported in: Portable Class Library
.NET for Windows Store Applications
Supported in: Windows 8

... whereas Type.GetTypeCode has:

Version Information
.NET Framework
Supported in versions: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Portable class library
Supported in: Portable Class Library

(Note the lack of mention in the Windows Store.)

+4
source

Source: https://habr.com/ru/post/1447163/


All Articles