虽然我的团队其他成员正在使用VS2012,但我是团队中第一个切换到VS2013的成员。我注意到的第一个主要差异之一是,对于相同的项目/解决方案,VS2012正在为我的RESX本地化文件生成附属程序集,但VS2013却没有。所有资源都嵌入在主程序集中。
如何让VS2013自动生成附属程序集?
更新:以下是构建日志的一个有趣部分:
似乎没有正确检测到培养物。在VS2012构建日志中,它是。
2>Target "SplitResourcesByCulture" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "..." (target "PrepareResourceNames" depends on it):
2>Task "Warning" skipped, due to false condition; ('@(ResxWithNoCulture)'!='') was evaluated as (''!='').
2>Task "Warning" skipped, due to false condition; ('@(ResxWithCulture)'!='') was evaluated as (''!='').
2>Task "Warning" skipped, due to false condition; ('@(NonResxWithCulture)'!='') was evaluated as (''!='').
2>Task "Warning" skipped, due to false condition; ('@(NonResxWithNoCulture)'!='') was evaluated as (''!='').
2>Task "AssignCulture"
2> Culture of "" was assigned to file "Documentation\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Documentation\Resources\Messages.resx".
2> Culture of "" was assigned to file "Modules\Analysis\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Modules\Analysis\Resources\Messages.resx".
2> Culture of "" was assigned to file "Infrastructure\Resources\Features.fr.resx".
2> Culture of "" was assigned to file "Infrastructure\Resources\Features.resx".
2> Culture of "" was assigned to file "Modules\Reporting\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Modules\Reporting\Resources\Messages.resx".
2> Culture of "" was assigned to file "Controls\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Controls\Resources\Messages.resx".
2> Culture of "" was assigned to file "Infrastructure\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Infrastructure\Resources\Messages.resx".
2> Culture of "" was assigned to file "Infrastructure\Resources\StructureItemAttributes.fr.resx".
2> Culture of "" was assigned to file "Infrastructure\Resources\StructureItemAttributes.resx".
2> Culture of "" was assigned to file "Modules\Data\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Modules\Data\Resources\Messages.resx".
2> Culture of "" was assigned to file "Modules\Home\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Modules\Home\Resources\Messages.resx".
2> Culture of "" was assigned to file "Modules\License\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Modules\License\Resources\Messages.resx".
2> Culture of "" was assigned to file "Modules\Menu\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Modules\Menu\Resources\Messages.resx".
2> Culture of "" was assigned to file "Modules\Options\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Modules\Options\Resources\Messages.resx".
2> Culture of "" was assigned to file "Modules\Structure\Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Modules\Structure\Resources\Messages.resx".
2> Culture of "" was assigned to file "Resources\Messages.fr.resx".
2> Culture of "" was assigned to file "Resources\Messages.resx".
2>Done executing task "AssignCulture".
答案 0 :(得分:1)
这个问题是由于CultureInfo.GetCultures返回一个空集合。修复如下(this separate question的答案我也打开了):
检查是否存在密钥HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Nls \ ExtendedLocale。如果缺少,可以通过添加此密钥来解决known issue。
只需添加'ExtendedLocale'注册表项即可。