Xamarin自动生成的AppResources.Designer.cs不采用ResourceManager baseName中的子文件夹名称
我正在Xamarin中从事iOS+Android项目(不是Xamarin表单)。 该应用程序需要支持多种语言,并且使用AppResources文件可以正确地进行本地化 为了干净的代码设置和更好的管理,Xamarin自动生成的AppResources.Designer.cs不采用ResourceManager baseName中的子文件夹名称,xamarin,xamarin-studio,Xamarin,Xamarin Studio,我正在Xamarin中从事iOS+Android项目(不是Xamarin表单)。 该应用程序需要支持多种语言,并且使用AppResources文件可以正确地进行本地化 为了干净的代码设置和更好的管理,AppResources文件存储在核心项目基础目录中的Resx目录中 在更新AppResources.resx文件时,Xamarin会自动重新创建 AppResources.Designer.cs文件位于创建ResourceManager时使用基本名称ProjectName.AppResources
AppResources
文件存储在核心项目基础目录中的Resx目录中
在更新AppResources.resx
文件时,Xamarin会自动重新创建
AppResources.Designer.cs
文件位于创建ResourceManager
时使用基本名称ProjectName.AppResources
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("ProjectName.AppResources", typeof(AppResources).GetTypeInfo().Assembly);
但是,由于所有应用程序资源都存储在Resx文件夹下,因此我希望使用基本名称ProjectName.Resx.AppResources创建ResourceManager
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("ProjectName.AppResources", typeof(AppResources).GetTypeInfo().Assembly);
我应确保AppResources.Designer.cs文件创建时考虑了正确的文件夹/命名空间路径,并应进行哪些更改?这是报告的已知问题
通过在“文件属性”窗格中将资源文件的资源Id从
ProjectName.Rexx.AppResources.resources
更改为ProjectName.AppResources.resources
,修复了此问题。虽然我找到了自己问题的答案,但我不会结束此问题,因为答案可能对其他人有所帮助。