问题
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