3

What is the correct way to use internationalization in a Asp.net 5 MVC project ?

If I try to decorate my model classes with DisplayName for example, Visual Studio gives me an error:

Severity Code Description Project File Line Error CS0246 The type or namespace name 'DisplayName' could not be found (are you missing a using directive or an assembly reference?) MyProject.DNX Core 5.0 C:\Users\paulo\Documents\Visual Studio 2015\Projects\MyProject\src\MyProject\Models\Post.cs 20

I can´t even create a resource file in this type of project.

Beetlejuice
  • 4,052
  • 10
  • 50
  • 82
  • possible duplicate of [Localization of DisplayNameAttribute](http://stackoverflow.com/questions/356464/localization-of-displaynameattribute) – Sly Aug 04 '15 at 18:44
  • Asp.net 5 does not introduce new ways to do this? That was a 2010 post. – Beetlejuice Aug 04 '15 at 18:57

1 Answers1

-1

You need to reference and import the namespace that defines this attribute:

`using System.ComponentModel;`
G. Stoynev
  • 6,941
  • 6
  • 37
  • 49