相关疑难解决方法(0)

System.Type.FullName的意外值

我最近需要为任意类型构建C#特定名称(必须始终包含global :: specifier),并且遇到以下问题:

// 1 - value: System.String[,,,][,,][,]
string unexpectedFullName = typeof( string[,][,,][,,,] ).FullName;      

// 2 - value: System.String[,][,,][,,,]
string expectedFullName = Type.GetType( "System.String[,][,,][,,,]" ).FullName;
Run Code Online (Sandbox Code Playgroud)

我期待两种情况下返回的值都相同.但是,由于某种原因,数组相关的部分值似乎是相反的(案例1).这是逆转的预期行为吗?

.net c# typeof multidimensional-array gettype

20
推荐指数
1
解决办法
911
查看次数

标签 统计

.net ×1

c# ×1

gettype ×1

multidimensional-array ×1

typeof ×1