xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.87k forks source link

GENERATEPROJECTPRIFILE : warning : PRI263: 0xdef01051 - No default or neutral resource given for 'Files/App1.resources.dll'. The application may throw #15813

Closed vsfeedback closed 1 year ago

vsfeedback commented 1 year ago

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] I created a store package for a Xamarin Forms (UWP) application based on the following website and received a warning.

GENERATEPROJECTPRIFILE : warning : PRI263: 0xdef01051 - No default or neutral resource given for 'Files/App1.resources.dll'. The application may throw an exception for certain user configurations when retrieving the resources.

https://devblogs.microsoft.com/xamarin/add-languages-to-your-apps-with-xamarin-and-multilingual-app-toolkit/

The reproduction procedure is as follows:

  1. Create a Xamarin.Forms project (App1)
  2. In the App1.UWP (Universal Windows) project, set the default language in the package manifest to "en-US".
  3. Set the neutral language of the class library (App1) to "en-US".
  4. Create a resource file in the class library (App1) (Resources/Resource1.resx)
  5. Enable the use of the multilingual application toolkit in the class library (App1).
  6. Add language (ja-JP) to the class library (App1)
  7. Create an app package for the store from the Create Package menu in the App1.UWP (Universal Windows) project.

Original Comments

Feedback Bot on 9/2/2022, 00:45 AM:

(private comment, text removed)

Feedback Bot on 11/30/2022, 10:55 PM:

(private comment, text removed)


Original Solutions

(no solutions)

jfversluis commented 1 year ago

I don't think this is something specific to Xamarin.Forms.

In your UWP and/or Xamarin.Forms project you can try adding this: [assembly: NeutralResourcesLanguage("en-US")] that will specify the neutral language. Additionally, I think the language identifier needs to match case.

Hope that helps!