Unknown parser error while trying to add resources

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

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

and after starting the application, I get this XamlParseException: Unknown parser error: Scanner 2147500037.

Here is the 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>
+5
source share
1 answer

Fix this issue by creating the MyProject.LocalizedResources project instead of MyProject.Resources

Xmlns: resources = "CLR namespaces: MyProject.LocalizedResources; assembly = MyProject.LocalizedResources"

Now it works well.

One word Resources in the project name lead to an error !: (

+4
source

All Articles