1

虽然我团队的其他成员都在使用 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".
4

1 回答 1

1

此问题是由于 CultureInfo.GetCultures 返回一个空集合。修复如下(我也打开了这个单独问题的答案):

检查是否存在键 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\ExtendedLocale。如果缺少它,则存在一个已知问题,可以通过添加此密钥来解决。

只需添加“ExtendedLocale”注册表项就可以了。

于 2014-08-20T23:46:10.240 回答