windows-phone-7 - 在 Windows Phone 8 中,我不断收到 System.WIndows.Markup.XamlParseException

标签 windows-phone-7 windows-phone windows-phone-8

我得到的错误信息是

A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.ni.dll



调用堆栈可追溯到这段代码。


 public MainPage()
        {
            **InitializeComponent();**
            this.Init();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);


        }

以及 InitializeComponent() 行上的错误。
public void InitializeComponent() {
        if (_contentLoaded) {
            return;
        }
        _contentLoaded = true;
        System.Windows.Application.LoadComponent(this, new System.Uri("/App;component/MainPage.xaml", System.UriKind.Relative));
        this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
        this.SSIDTextBox = ((System.Windows.Controls.TextBox)(this.FindName("SSIDTextBox")));
        this.PasswordTextBox = ((System.Windows.Controls.TextBox)(this.FindName("PasswordTextBox")));
        this.Auth_ListPicker = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("Auth_ListPicker")));
        this.SaveButton = ((System.Windows.Controls.Button)(this.FindName("SaveButton")));
        this.GenerateButton = ((System.Windows.Controls.Button)(this.FindName("GenerateButton")));
        this.QRImage = ((System.Windows.Controls.Image)(this.FindName("QRImage")));
        this.Profiles= ((System.Windows.Controls.ListBox)(this.FindName("Profiles")));
    }
}

在将 WP 7.1 转换为 WP8 之前,我没有收到此异常。

任何帮助,将不胜感激。

更新 :
我添加了整个异常消息,它有助于查明问题吗?

'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: DefaultDomain): Loaded 'C:\windows\system32\mscorlib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.RuntimeHost.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Net.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\Data\Programs{64003C1B-A4FD-41FF-A132-2B6C9FE8EDC9}\Install\WifiQR.DLL'. Symbols loaded. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.Interop.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\Data\Programs{64003C1B-A4FD-41FF-A132-2B6C9FE8EDC9}\Install\Microsoft.Phone.Controls.Toolkit.DLL'. Cannot find or open the PDB file. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\Data\Programs{64003C1B-A4FD-41FF-A132-2B6C9FE8EDC9}\Install\microsoft.phone.controls.DLL'. Cannot find or open the PDB file. 'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Core.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.ni.dll

最佳答案

只需在 list 文件中添加权限即可。

  • 转到 WMAppmanifest.xml
  • 选择“能力”选项卡
  • 现在检查“ID_CAP_MAP”
  • 关于windows-phone-7 - 在 Windows Phone 8 中,我不断收到 System.WIndows.Markup.XamlParseException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14117908/

    相关文章:

    c# - 我正在 Windows Phone 8 中制作手电筒应用程序,但我无法关闭 LED,我该怎么做?

    c# - 如何在 Windows Phone 8.1 中缓存页面

    windows-phone-7 - 如何用手指在WP7中画出形状?

    silverlight - 在列表框的末尾添加加载更多按钮而不会丢失虚拟化?

    用于在应用程序中呈现网站的 Android 库

    javascript - 如何填充 Windows 8.1 动态磁贴?

    windows - 如何使用路径名从 windows phone (8.1) 音乐库中检索文件?

    c# - 如何获取 WP7 内容项目中的 Assets 列表?

    windows-phone-7 - 如何降级 Windows Phone 8 应用程序?

    iphone - 您可以从另一个应用程序中删除一个应用程序吗?