本文介绍了Winmd文件的255.255.255.255版本表示什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到大多数(全部?) .winmd 文件的版本为 255.255.255.255 ,例如:

I noticed that most (all?) .winmd files have a version of 255.255.255.255 like:

Windows,版本= 255.255.255.255,文化=中性,PublicKeyToken =空

Metro应用程序使用此版本号引用此类程序集.

Metro apps have a reference to such assemblies with this version number.

进一步Windows.winmd本身引用:

Further the Windows.winmd itself references:

mscorlib,版本= 255.255.255.255,文化=中性,PublicKeyToken = b77a5c561934e089

据我所知,具有该版本号的程序集不存在.

However, an assembly with this version number does not exist, as far as I know.

此版本号有特殊含义吗?有任何相关文档吗?

Does this version number have a special meaning? Is there any documentation for this?

推荐答案

ECMA 335程序集需要具有版本号.但是Windows运行时类型解析算法不使用版本号,因此创建winmd格式的团队选择了程序集版本号为255.255.255.255的任意版本号.

ECMA 335 assemblies need to have a version number. But the windows runtime type resolution algorithm doesn't use the version number, so the team creating the winmd format chose an arbitrary version number of 255.255.255.255 for the assembly version number.

这有助于确保在进行类型解析时没有人尝试使用.Net类型解析算法(这并不完美,不幸的是,某些工具仍在使用.Net类型解析算法).

That helps to ensure that nobody attempts to use the .Net type resolution algorithm when doing type resolution (it's not perfect, unfortunately some tools still use the .Net type resolution algorithm).

哦,mscorlib参考是形式参考-ECMA 335要求所有typeref都具有相应的assemblyref,并且WINMD文件格式选择为某些ECMA 335类型使用typeref作为特定类型的指示符.例如,winrt枚举"构造表示为扩展"System.Enum"的类型-对于winmd文件,"System.Enum"部分只是一个字符串(可以是任何东西),无法解析为一个真实的类型.该字符串在元数据中表示为typeref,而typerefs必须具有Assemblyref-我们选择使用System.Enum的mscorlib版本作为枚举的assemblyref,因为它很方便.

Oh and the mscorlib reference is a pro-forma reference - ECMA 335 requires that all typeref's have a corresponding assemblyref and the WINMD file format chose to use typerefs to certain ECMA 335 types as indicators of a specific type. For example, the winrt "enum" construct is represented as a type which extends "System.Enum" - for a winmd file the "System.Enum" part is just a string (it could have been anything), and cannot be resolved to a real type. That string is represented in metadata as a typeref and typerefs have to have an assemblyref - we chose to use the mscorlib version of System.Enum as the assemblyref for the enum because it was convenient.

这篇关于Winmd文件的255.255.255.255版本表示什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 10:25