gpt4 book ai didi

silverlight - 尝试添加资源时出现未知解析器错误

转载 作者:行者123 更新时间:2023-12-03 01:28:50 24 4
gpt4 key购买 nike

我在向我的 wp7 项目添加资源时遇到问题。我已经添加了

        <resources:LocalizedStrings x:Key="LocalizedStrings"/>

运行应用程序后,我收到这样的 XamlParseException: Unknown parser error: Scanner 2147500037。

这是代码。

        <Application 
x:Class="MyProject.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:vm="clr-namespace:MyProject.ViewModels;assembly=MyProject.ViewModels"
xmlns:resources="clr-namespace:MyProject.Resources;assembly=MyProject.Resources">
<Application.Resources>
<ResourceDictionary>

<resources:LocalizedStrings x:Key="LocalizedStrings"/>
<vm:ViewModelLocator x:Key="Locator"/>

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="styles/globalstyles.xaml"/>
<ResourceDictionary Source="styles/UserStyles.xaml"/>
<ResourceDictionary Source="styles/DialogStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

<Application.ApplicationLifetimeObjects>
<shell:PhoneApplicationService
Launching="Application_Launching" Closing="Application_Closing"
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
</Application.ApplicationLifetimeObjects></Application>

最佳答案

通过创建项目 MyProject.LocalizedResources 而不是 MyProject.Resources 来解决此问题

xmlns:resources="clr-namespace:MyProject.LocalizedResources; assembly=MyProject.LocalizedResources"

现在效果很好。

项目名称中的单个单词Resources会导致错误! :(

关于silverlight - 尝试添加资源时出现未知解析器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11914752/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com