Class Library (Portable for Universal Apps) System.Diagnostics.StackTrace limitations and referencing assemblies targeted at another runtime

[亡魂溺海] 提交于 2019-12-11 02:01:42

问题


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 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.

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


回答1:


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

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



来源:https://stackoverflow.com/questions/27660915/class-library-portable-for-universal-apps-system-diagnostics-stacktrace-limita

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!