类库(通用应用程序可移植) System.Diagnostics.StackTrace 限制和引用针对另一个运行时的程序集 [英] Class Library (Portable for Universal Apps) System.Diagnostics.StackTrace limitations and referencing assemblies targeted at another runtime

查看:15
本文介绍了类库(通用应用程序可移植) System.Diagnostics.StackTrace 限制和引用针对另一个运行时的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Visual Studio 2013 Ultimate Update 4 创建一个类型为类库(通用应用程序可移植)"的新项目.由此产生的 PCL 针对两个平台,即 Windows 8.1 和 Windows Phone 8.1,这正是我所需要的.

I use Visual Studio 2013 Ultimate Update 4 to create a new project of type "Class Library (Portable for Universal Apps)". The resulting PCL is targeted at two platforms i.e. Windows 8.1 and Windows Phone 8.1 and this is what I need.

System.Diagnostics.StackTrace此子集中不支持 类.对于我的其他应用程序,我大量使用此类进行跟踪和异常记录.经过一段时间的反复试验,我发现我可以简单地将来自我的 Windows Phone 8.1 Store 应用程序或针对 Windows 8.1/Windows Phone 8.1 的 PCL 的引用设置为针对 Silverlight 5 的程序集,并且在该引用的程序集中我可以利用 System.Diagnostics.StackTrace 类,这确实有效.

System.Diagnostics.StackTrace class is not supported in this subset. For my other applications I heavily utilize this class for purposes of tracing and exception logging. After a while of trial and error I found out that I can simply set a reference from my Windows Phone 8.1 Store App or from a PCL targeted at Windows 8.1/Windows Phone 8.1 to an assembly targeted at Silverlight 5 and in that referenced assembly I can utilize the System.Diagnostics.StackTrace class and this actually works.

在上述场景中使用 System.Diagnostics.StackTrace 类是否存在任何技术缺陷?

Are there any technical drawbacks in utilizing the System.Diagnostics.StackTrace class in the mentioned scenario?

推荐答案

此类引用未通过 Windows App Certification Kit 3.4支持的 API 测试"

Such a reference fails Windows App Certification Kit 3.4 "Supported API test"

此应用程序类型不支持此 API - Api=System.Diagnostics.StackTrace.模块=MSCORLIB,PUBLICKEYTOKEN=7CEC85D7BEA7798E.文件=MyLib1.dll.

This API is not supported for this application type - Api=System.Diagnostics.StackTrace. Module=MSCORLIB, PUBLICKEYTOKEN=7CEC85D7BEA7798E. File=MyLib1.dll.

这篇关于类库(通用应用程序可移植) System.Diagnostics.StackTrace 限制和引用针对另一个运行时的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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