I\'m trying to use DataAnnotations in my WPF project to specify a maximum length of strings, with the following:
using System.ComponentModel.DataAnnotations;
Use the FrameWork version 4.5 and above for your project then problem solved.Because this namespace is under 4.5 and above.