Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown parser error when try to add resources

I have problem with adding resources to my wp7 project. I have added

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

and after running application I recieve such XamlParseException: Unknown parser error: Scanner 2147500037.

Here is code.

        <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>
like image 685
CatCap Avatar asked Oct 07 '22 23:10

CatCap


1 Answers

Resolve this issue by creating project MyProject.LocalizedResources instead of MyProject.Resources

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

This works well now.

Single word Resources in project name leads to the error! :(

like image 170
CatCap Avatar answered Oct 10 '22 03:10

CatCap