本地化应用程序错误消息:不一致的可访问性:属性类型 [英] Localizing app error message : Inconsistent accessibility: property type

查看:67
本文介绍了本地化应用程序错误消息:不一致的可访问性:属性类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误消息:
可访问性不一致:属性类型'Comm.Resources.AppResources'的访问权限小于属性'Comm.Resources.LocalizedStrings.LocalizedResources'
我已经完成了这些:

I have this error message:
Inconsistent accessibility: property type 'Comm.Resources.AppResources' is less accessible than property 'Comm.Resources.LocalizedStrings.LocalizedResources'
I have done these :




1)) in App.xaml

< Application.Resources >
        < local:LocalizedStrings  xmlns:local="clr-namespace:Comm.Resources"
            x:Key="LocalizedStrings"/>
   </Application.Resources >



2) add this class LocalizedStrings in a Folder call Resources


namespace Comm.Resources
{
  public class LocalizedStrings
  {
    public LocalizedStrings()
    { }

            private static Comm.Resources.AppResources localizedResources = new Comm.Resources.AppResources();

            public Comm.Resources.AppResources LocalizedResources { get { return localizedResources; } }

   }
}




非常感谢您的帮助.



Your help is much appreciated.

推荐答案

双击AppResources.resx打开资源编辑器.现在,在窗口顶部附近的某个地方,您会看到一个下拉菜单,可用于设置生成的AppResources类的访问修饰符.选择公共".
Double-click on AppResources.resx to open the resource editor. Somewhere near the top of the window you'll now see a dropdown which allows you to set the access modifier of the generated AppResources class. Select "public".


这篇关于本地化应用程序错误消息:不一致的可访问性:属性类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆