I\'m trying to use DataAnnotations in my WPF project to specify a maximum length of strings, with the following:
using System.ComponentModel.DataAnnotations;
I had same problem, I solved this problem by following way.
Right click on page, select Property. in build action select Content.
Hope that this solution may help you.