从Windows Phone 7.5项目升级到WP8的问题

时间:2014-03-11 20:53:43

标签: c# windows-phone-7 windows-phone-8 windows-phone

我正在尝试维护针对WP7.5和WP8的两个版本的应用。我从WP7.5应用程序开始,并添加了一个包含链接文件的项目副本。然后我通过Visual Studio命令将“链接”项目升级到WP8。当我在模拟器上运行WP8应用程序时,它在执行System.InvalidOperationException in System.Windows.ni.dll命令时会以MessageBox.Show()崩溃。输出窗口在前面提到的错误消息之前显示FileNotFoundException in mscorlib.ni.dll

我尝试将mscorlib.dll添加到WP8项目中,但VS告诉我它已被引用。我也尝试在WMAppManifest中设置所有功能,如同在类似的线程中所见,但问题仍然存在。谁能给我一个提示?

以下是执行后的输出。我希望你不介意德语。

enter image description here

1 个答案:

答案 0 :(得分:0)

Windows 8 Windows Phone 8: In Windows Phone 8 if you call Show method from the app Activated or Launching event handlers an InvalidOperationException is thrown with the message Error Displaying MessageBox. Alternatively, you should call the Show method from the Page.OnNavigatedTo(NavigationEventArgs) method.

在MSDN中发现这适用于我的情况。这正是我的问题。