Surface Runtime Exception on Windows 8

半世苍凉 提交于 2020-01-06 07:43:00

问题


We are experiencing a strange problem with a software we already developed few month ago, today we had to reopen the app for the customer to make some improvement. But a strange exception start to show up. it seem that is coming from the ScatterView. But the strange thing the app is working on production and the code is the same what could be the cause? Here the exception.

System.TypeInitializationException was unhandled
HResult=-2146233036
Message=The type initializer for 'Microsoft.Surface.Presentation.Input.InteractiveSurface'  threw an exception.
Source=Microsoft.Surface.Presentation
TypeName=Microsoft.Surface.Presentation.Input.InteractiveSurface

Here you can find the full stack trace http://pastebin.com/y3vVurfm

Thanks I forgot to say the app is developed on .net 4.5


回答1:


The runtime exception you are facing might be the result that you are compiling for Any CPU and are now using an x64 operating system. You can overcome this by recompiling for x86 only.

Please note: on Windows 8 there are some other restrictions in regard to have an application running that targets Microsoft Pixelsense / Samsung SUR40 (touch events not being reported). The Pixelsense SDK was created when Microsoft Windows 8 wasn't released yet, so don'T expect this being supported.

If you want to have support for both platforms see https://blogs.sevensteps.com/Lists/Posts/Post.aspx?ID=10 for an idea on how to achieve this.




回答2:


I encountered the same problem and finally found a solution:

The exception is thrown by a function in GetItemOrientation in Microsoft.Surface.Presentation.Controls.ScatterCanvas.

You can omit the failing function call in GetItemOrientation by setting the Orientation property on the ScatterViewItem yourself or by setting ScatterViewItem.CanRotate = false.



来源:https://stackoverflow.com/questions/16187718/surface-runtime-exception-on-windows-8

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