-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Description
environment
- Windows 10 Enterprize N + japanese lang pack
- Visual Studio 2015 Enterprize (ja-jp localized)
repro steps
- create new ASP.NET Web Application project
- add Resource.resx
- define
Passwordresource - edit
ViewModels/Account/LoginViewModel.cs
[Required]
[DataType(DataType.Password)]
[Display( ResourceType = typeof(Resource), Name ="Password")]
public string Password { get; set; }
run application and go to login page
expected result
Login form field label shown as resource defined text.
actual result
An unhandled exception occurred while processing the request.
InvalidOperationException: ローカライズに失敗したため、プロパティ 'Name' を取得できません。型 'WebApplication1.Resource' がパブリックでないか、'Password' という名前のパブリックで静的な文字列プロパティが含まれていません。
場所 System.ComponentModel.DataAnnotations.LocalizableString.<>c__DisplayClass0.<GetLocalizableValue>b__3()
error was reports WebApplication1.Resource is not public or 'Password' is not public static.
in generated Resources.Designer.cs
internal class Resource {
snip
internal static string Password {
get {
return ResourceManager.GetString("Password", resourceCulture);
}
}
}
- Resource class generated with
internal - Password property generated with
internal static