在Win8认证中使用4.5 Framework的标准方法失败 [英] Use of standard methods from 4.5 Framework fails at Win8 certification

查看:100
本文介绍了在Win8认证中使用4.5 Framework的标准方法失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图摆脱Win8认证工具发出的所有消息错误。我只剩下一个错误,但似乎很难解决它。

I'm trying to get rid off all message errors issued by the Win8 certification tool. I have only one error remaining but It seems difficult to resolve it.

基本上,我正在构建我的库来对抗4.5 Framework(而不是4.5 Core)但我有一个属性访问权限失败:
typeof(MyType).GetTypeInfo()。GUID  ,显示以下消息:

Basically, I'm building my library against the 4.5 Framework (not the 4.5 Core) but I have one property access that is failing : typeof(MyType).GetTypeInfo().GUID  with the following message:

" 此系统不支持MSCORLIB中的API System.Type.get_GUID,PUBLICKEYTOKEN = B77A5C561934E089。 SharpDX.dll调用此API。"

"API System.Type.get_GUID in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. SharpDX.dll calls this API."

问题是 TypeInfo 类之间有不同的类继承层次结构4.5 Core和4.5 Framework:

The problem is that TypeInfo class has a different class inheritance hierarchy between 4.5 Core and 4.5 Framework:

- 在4.5上, TypeInfo 继承自Type。当我们从 TypeInfo 类访问
GUID
属性时,它会解析为Type类(这是我得到的错误。)

- On 4.5, TypeInfo is inheriting from Type. When we access the GUID property from the TypeInfo class, it resolves to the Type class (this is the error I'm getting).

- 在4.5 Core上, TypeInfo 不继承Type并在本地定义
GUID 属性。我应该参考这个方法,但似乎不可能从标准的4.5程序集中引用它。

- On 4.5 Core, TypeInfo is not inheriting Type and is defining locally the GUID property. I should reference this method, but It seems impossible to reference it from a standard 4.5 assembly.

所以似乎无法通过使用4.5 Framework编译应用程序来通过认证,即使它正在使用授权4.5 Core API。

So It seems not possible to pass certification by compiling an application with 4.5 Framework even if it is using authorized 4.5 Core API.

是因为Win8认证工具仍然不准确或有任何解决方法吗?

Is it because Win8 Certification Tool is still inaccurate or is there any workaround?

推荐答案

嗨亚历山大,

感谢您的反馈。不幸的是,您的方案不受支持,通常甚至不起作用。如果您想创建可移植代码,则需要使用Portable Class Libary(PLIB)功能。这样,您就可以创建一个可以在Metro和经典.NET 4.5应用程序之间共享的
的二进制文件。仅仅针对通用API集进行编译是不够的,因为.NET 4.5和Metro没有相同的装配因子。这将导致在编译时出现类型检查错误。到目前为止,你有
幸运地只暴露属于PLIB因子的类型(我们明确添加了支持),因此它似乎正在工作。

Thank you for your feedback. Unfortunately, your scenario is not supported and generally does not even work. If you want o create portable code, then you need to use the Portable Class Libary (PLIB) feature. This way, you can create a single binary that you can share between Metro and classic .NET 4.5 apps. Just compiling against the common API set is not sufficient because .NET 4.5 and Metro do not have the same assembly factoring. This will result in type checking errors at compile time. So far you have just been lucky to only expose types that are part of the PLIB factoring (for which we explicitly added supported) and thus it just appears to be working.

此时,Porable Library不支持COM。我们正在考虑缩小这一差距,但我不能就我们是否真的会在这个版本中做到这一点做出任何承诺。

At this point, COM is not supported in Porable Library. We are looking into closing this gap, but I cannot make any promises on whether we will actually be doing it in this release.

请问为什么需要访问GUID属性?

May I ask why need to get access to the GUID property?

谢谢,


这篇关于在Win8认证中使用4.5 Framework的标准方法失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆