Why can't I reference System.ComponentModel.DataAnnotations?

后端 未结 14 1731
遥遥无期
遥遥无期 2020-11-28 08:47

I\'m trying to use DataAnnotations in my WPF project to specify a maximum length of strings, with the following:

using System.ComponentModel.DataAnnotations;         


        
14条回答
  •  余生分开走
    2020-11-28 09:41

    This error occurs when the reference to the "System.dll" got removed.Solution to the problem is very simple add the reference to "System.dll".The dll is normally available in the following location
    "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" .Add the reference your problem will get solved .
    

提交回复
热议问题