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

前端 未结 1 614
青春惊慌失措
青春惊慌失措 2021-01-19 06:26

Can someone please help me learn how to read and navigate the msdn docs?

Is this not supported in .net 4.0+ ?

using System;

...

public static bool          


        
1条回答
  •  一生所求
    2021-01-19 06:51

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

    If you look at the Type class documentation in .NET 4.5, you can see a green shopping bag next to all of the members which are supported in Windows Store apps.

    You can also look at the bottom of the page for each individual member. For example, Type.GetArrayRank has this:

    Version Information
    .NET Framework
    Supported in: 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 apps
    Supported in: Windows 8

    ... whereas Type.GetTypeCode has:

    Version Information
    .NET Framework
    Supported in: 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 a mention of Windows Store.)

    0 讨论(0)
提交回复
热议问题