简体   繁体   English

如何将App-GlobalResources文件夹中lang.resx的禁用访问修饰符更改为public?

[英]how to change disabled access modifier of lang.resx within App-GlobalResources folder to public?

I am trying to use resources(language) within App-GlobalResources folder. 我正在尝试使用App-GlobalResources文件夹中的资源(语言)。 But when i run the project it says this; 但是,当我运行该项目时,它会说:

Cannot retrieve property 'Name' because localization failed. 由于本地化失败,无法检索属性“名称”。 Type 'Resources.lang' is not public or does not contain a public static string property with the name 'Username'. 类型“ Resources.lang”不是公共的,或者不包含名称为“用户名”的公共静态字符串属性。

Access modifier is disabled so i can not change it to public which i think it is the source of problem, i am not sure though. 访问修饰符已禁用,因此我无法将其更改为公开,我认为这是问题的根源,但我不确定。

How can i get it work? 我该如何运作?

For solution: 

This works 这有效

Select the file in the Solution Explorer and go to it's properties by right-clicking on the file or by pressing F4. 在解决方案资源管理器中选择文件,然后通过右键单击文件或按F4进入其属性。

In the properties window for this file, you can change the access modifier of the file from Protected to Public. 在此文件的属性窗口中,可以将文件的访问修饰符从“受保护”更改为“公共”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将窗口的访问修饰符从公共更改为内部? - How can i change the Access Modifier of a Window from public to internal? 修改公共财产的访问修饰符是一个突破性的变化吗? - Is it a breaking change that modifying the access modifier of a public property? 更改资源文件(resx)命名空间和访问修饰符 - Changing Resource files (resx) namespace and access modifier 如何将resharpers默认访问修饰符更改为public而不是内部生成的类? - How to change resharpers default access modifier to public instead of internal for generated classes? 更改localization.resx始终会将public更改为internal修饰符 - Changing the localisation.resx always changes the public to internal modifier 如何限制引用库中的公共访问修饰符? - How can I restrict public access modifier in referenced library? 如何更改用户控件的访问修饰符 - How to change the access modifier of a user control 访问修饰符选项在 RESX 文件中的实际作用是什么? - What does the Access Modifier option actually do in a RESX file? 在运行时更改访问修饰符 - Change the access modifier in runtime 将.NET中的访问修饰符从共享组件中的私有更改为私有是一项重大更改吗? - Is changing an access modifier in .NET from private to public in share component a breaking change?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM