我正在定制一个开源 .NET 应用程序。它编译得很好。但是表单和控件拒绝在设计器中显示,并抛出以下错误:
The satellite assembly named "XX.dll" for fallback culture "en-US" either could not be found or could not be loaded. This is generally a setup problem. Please consider reinstalling or repairing the application.
我知道这是一个多语言应用程序,但我想放弃其他语言并坚持通过表单设计器进行简单的字幕自定义。
此外,该问题会阻止将图像添加到控件。与以下行相同的异常发生:
((System.Drawing.Image)(resources.GetObject("ItemXXX.Glyth")));
我需要更改什么才能禁用卫星程序集资源?
谢谢...
最佳答案
这是解决问题的方法,但要修复它,请将 UICulture
添加到项目文件中匹配的 PropertyGroup
这
NeutralResourcesLanguage
在 AssemblyInfo
文件中使用。然后,如果需要,您可以满足 FxCop 警告 CA1824。
例如在 AssemblyInfo
中:
[assembly: NeutralResourcesLanguage("en-GB", UltimateResourceFallbackLocation.Satellite)]
在项目文件中(例如.csproj):
...
<PropertyGroup Condition="...">
...
<UICulture>en-GB</UICulture>
...
</PropertyGroup>
...
关于c# - .NET 应用程序中找不到名为 "XX.dll"的后备文化 "en-US"的附属程序集错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5079814/