【问题标题】:Could not find any resources appropriate for the specified culture or the neutral culture. - Resource file sharing problem找不到适合指定区域性或中性区域性的任何资源。 - 资源文件共享问题
【发布时间】:2010-09-21 09:01:21
【问题描述】:

我有一个普通的类库。最近,我对这个类库进行了本地化。

我还有一个 Silverlight 类库,基本上是一个链接文件项目

<Link>Reports\Reports.cs</Link>

其中,我包含了与其他文件相同的 resx 文件作为链接参考。在运行时,它会抛出以下异常。

Could not find any resources appropriate for the specified culture or the neutral culture.  
Make sure "BCL.Resources.BCLNamespace.resources" was correctly embedded
 or linked into assembly "SilverlightBCL" at compile time, or that all the 
 satellite assemblies required are loadable and fully signed.

【问题讨论】:

    标签: c# silverlight shared-libraries resx


    【解决方案1】:

    将 Assembly2 (SilverlightBCL) 中的默认命名空间与 Assembly1 (BCL) 保持相同可解决此问题。 谢谢大家:)

    【讨论】:

    • 我遇到了同样的问题,将两个项目属性更改为使用相同的默认命名空间。
    【解决方案2】:

    在 [Filename].Designer.cs 中,它可以是以下之一:

    • 命名空间

      namespace Company.Dept.MyApp.Resource {
          // Your code here.
      }
      
    • 资源管理器

      new global::System.Resources.ResourceManager(
          "Company.Dept.MyApp.Resource.Templates", 
          typeof(Templates).Assembly);
      

    【讨论】:

    • 你的问题是什么?这两个在我的项目中都可以,但仍然失败
    猜你喜欢
    • 2011-11-01
    • 2014-10-08
    • 1970-01-01
    • 1970-01-01
    • 2011-06-09
    • 2023-03-11
    • 1970-01-01
    相关资源
    最近更新 更多