在Metro风格的应用程序使用传统组件 [英] using legacy assemblies in metro style app

查看:134
本文介绍了在Metro风格的应用程序使用传统组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,我们可以访问在一个Metro风格的应用程序用C#在.NET API和所有的WinRT API的一部分。 但对于其他面向.NET 2.0和3.5,等第三方组件 我们才能够将其添加为引用的Metro风格应用程序的项目?

I understand that we can access part of the .net apis and all the winrt apis in a metro style app written in c#. But what about other third-party components that target .net 2.0 or 3.5, etc. will we be able to add them as references in a metro style app project?

推荐答案

有时您可以参考从地铁应用第三方.NET程序集。他们应该被部署在同一文件夹中您的应用程序,并且只使用支持的API。

Yes, sometimes you can reference third-party .NET assemblies from Metro applications. They should be deployed in the same folder as your app and only use supported APIs.

我创建了一个.NET库,一个类和地铁的应用程序中使用它。得到如下警告:该项目的EmptyLib不能被引用,但应用程序已建成和我能够调试和探索调试器我的类的实例。

I created a .NET library with one class and used it from metro app. Got the following warning: The project 'EmptyLib' cannot be referenced. But the app has been built and I was able to debug it and explore the instance of my class in debugger.

然后我试图通过Windows应用程序认证。它失败(详见下文)。

Then I tried to pass Windows App Certification. It failed (see details below).

开启编译器优化应用程序的认证后的通过

After switching on compiler optimization for app certification passed.

这是它失​​败的第一次是使用不支持的API库的原因。联系方式:

The reason that it failed the first time was that library used not supported APIs. Details:

错误:此应用程序无法支持的API检查

Error: This application failed the supported API check.

    在MSCORLIB
  • API System.Runtime.CompilerServices.CompilationRelaxationsAttribute公钥= B77A5C561934E089不支持此应用程序类型。 EmptyLib.dll调用这个API。

  • API System.Runtime.CompilerServices.CompilationRelaxationsAttribute in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. EmptyLib.dll calls this API.

API System.Runtime.CompilerServices.CompilationRelaxationsAttribute。#构造函数(System.Int32的)在MSCORLIB公钥= B77A5C561934E089不支持此应用程序类型。 EmptyLib.dll调用这个API。

API System.Runtime.CompilerServices.CompilationRelaxationsAttribute.#ctor(System.Int32) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. EmptyLib.dll calls this API.

如果不是固定不变的影响:该应用程序正在使用一个或多个API不在Windows SDK的Metro风格应用。使用不支持的API违反视窗存储策略,并且可以具有对用户体验的负面影响,并具有阻碍整个系统的稳定性的潜力。

Impact if not fixed: The application is using one or more APIs that are not in the Windows SDK for Metro style Apps. Use of unsupported APIs violates the Windows Store policy and can have negative impact on the user experience and has the potential to hinder overall system stability.

如何解决:在看短信above2对于需要修复的确切API错误。请参阅Windows SDK的Metro风格应用程序的API来使用的支持列表中。

How to fix: Look at the error messages above2 for the exact API that needs to be fixed. Refer to the Windows SDK for Metro style Apps for the supported list of APIs to use.

这篇关于在Metro风格的应用程序使用传统组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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