0

此代码中的“RootFrame =”行,所有这些都是自动生成的:

private void InitializePhoneApplication()
{
    if (phoneApplicationInitialized)
        return;

    // Create the frame but don't set it as RootVisual yet; this allows the splash
    // screen to remain active until the application is ready to render.
    RootFrame = new PhoneApplicationFrame();
    RootFrame.Navigated += CompleteInitializePhoneApplication;

    // Handle navigation failures
    RootFrame.NavigationFailed += RootFrame_NavigationFailed;

    // Handle reset requests for clearing the backstack
    RootFrame.Navigated += CheckForResetNavigation;

    // Ensure we don't initialize again
    phoneApplicationInitialized = true;
}

...失败:

*System.TypeInitializationException 未被用户代码处理 HResult=-2146233036 消息=“TaSLS_PhoneApp.App”的类型初始化程序引发了异常。Source=TaSLS_PhoneApp
TypeName=TaSLS_PhoneApp.App StackTrace:在 TaSLS_PhoneApp.App.set_RootFrame(PhoneApplicationFrame 值)在 TaSLS_PhoneApp.App.InitializePhoneApplication() 在 TaSLS_PhoneApp.App..ctor() InnerException: System.NotImplementedException HResult=-2147467263 消息=方法或操作未执行。Source=Windows StackTrace:在 Windows.Storage.ApplicationData.get_RoamingSettings() 在 TaSLS_PhoneApp.App..cctor() InnerException:*

4

1 回答 1

2

根本原因不是生成的代码,而是它正在调用的代码......

TaSLS_PhoneApp.App.InitializePhoneApplication() at TaSLS_PhoneApp.App..ctor() InnerException: System.NotImplementedException HResult=-2147467263 Message=方法或操作未实现。Source=Windows StackTrace:在 Windows.Storage.ApplicationData.get_RoamingSettings() 在 TaSLS_PhoneApp.App..cctor() InnerException:*

看起来您的应用程序InitializePhoneApplication正在调用 Windows phone 8 上未实现的 WinRT 函数。请参阅 MSDN 文档:http: //msdn.microsoft.com/en-gb/library/windows/apps/windows.storage。 applicationdata.roamingsettings

于 2013-01-15T16:45:24.017 回答