George Chondrompilas
George Chondrompilas

Reputation: 3237

WP8 App Crashes after localization

Recently, I decided to try the Multilingual App Toolkit in order to add localization support in my already existing WP8 application.

I followed the instructions, it generated the AppResources files for the languages I selected and it was ready to be tested. Unfortunately, every time I deploy the app to my device (tried with emulator too) it instantly crashes without any exception, message or any kind of other information. I tried to clean the project, delete bin and obj folders, disable the languages I added before and the Multilingual App Toolkit with no luck.

I created a new project just with the AppResources files and it worked fine. But, I don't think that the problem is in my code because it doesn't even reach the App() method in App.xaml.cs file before it crashes.

Anyone knows what's going on?

EDIT:
Does the Resources folder have a size limit?

EDIT 2:
I attached a debugger to the Visual Studio process and when I am running the project on my phone the following exceptions are thrown:

The thread 0x3d34 has exited with code 259 (0x103).

A first chance exception of type 'System.NotSupportedException' occurred in PresentationCore.dll

A first chance exception of type 'System.NotSupportedException' occurred in PresentationCore.dll

EnC: Enter Debug Mode: project 'ProjectName'

A first chance exception of type 'System.OutOfMemoryException' occurred in JetBrains.Platform.ReSharper.VisualStudio.Core.dll

The thread 0x1900 has exited with code 259 (0x103).

A first chance exception of type 'Microsoft.Build.Exceptions.InvalidProjectFileException' occurred in Microsoft.Build.dll

A first chance exception of type 'Microsoft.Build.Exceptions.InvalidProjectFileException' occurred in mscorlib.dll

The thread 0x27d0 has exited with code 259 (0x103).


Thanks

Upvotes: 2

Views: 256

Answers (4)

Diomedes Domínguez
Diomedes Domínguez

Reputation: 1101

That's a very rare problem. Try this: Create a new project with only the AppResources files & try to deploy the project. If the new app crash, then the problem its with the AppResources files; if not, then your problem is in your code.

Upvotes: 1

George Chondrompilas
George Chondrompilas

Reputation: 3237

I fixed this by doing what I wanted to avoid most;

I created a completely new project, copied all the files from the old project to the new one ( the localized files too). Everything works fine now.

I think there is something wrong with the ResX Custom Tool which generates the AppResources.Designer.cs file.

Upvotes: 2

Justin Markwell
Justin Markwell

Reputation: 341

first four things I would check is if the AppResources.resx access modifier is public

that the designer is not causing a error.

that the folder is named Resources.

multi lingual app toolkit is enabled in tools menu.

I have never ran into a size issue in the resources folder. I would recommend starting with one language then adding to the list after it is fully functional.

Upvotes: 2

Filip
Filip

Reputation: 1864

Did you move your localization files to another project or did some name changing?

If so, check [your resource file for English.Designer.cs

and there is code that looks for resources:

/// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Localization.Resources.AppResources", typeof(AppResources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

In my code, the string Localicazation.Resources.AppResources represents Project.Folder.ResourceFiles.

Upvotes: 1

Related Questions