在尝试编译我的 .Dll 时,我设法弄清楚了我的所有参考和错误,除了这两个(我有多个)。
“找不到类型或命名空间名称‘Display’(您是否缺少 using 指令或程序集引用?)”
“找不到类型或命名空间名称‘DisplayAttribute’(是否缺少 using 指令或程序集引用?)”
我正在使用 System.ComponentModel 和 System.ComponentModel.DataAnnotations。请原谅我,因为我对所有这些都非常模糊,我只是对这个项目进行了微小的改变。我不明白我缺少什么参考会导致这些错误,我也确定问题是由于我的经验不足造成的。任何帮助表示赞赏,谢谢。
一小部分代码:
using PatientTracker.Entities.Validation;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.Xml.Serialization;
namespace PatientTracker.Entities
{
[Serializable]
public abstract class EntityBaseCore : IEntity, INotifyPropertyChanged, IDataErrorInfo, IDeserializationCallback, INotifyPropertyChanging
{
[Display(AutoGenerateField = false)]
[NonSerialized]
protected bool bindingIsNew = true;
[Display(AutoGenerateField = false)]
[NonSerialized]
private bool isEntityTracked;
[Display(AutoGenerateField = false)]
[NonSerialized]
private bool suppressEntityEvents;
private string entityHashCode;
[NonSerialized]
private object tag;
[NonSerialized]
private ValidationRules _validationRules;
[Display(AutoGenerateField = false)]
public abstract string TableName { get; }
[Display(AutoGenerateField = false)]
public abstract string[] TableColumns { get; }
[Browsable(false)]
[Display(AutoGenerateField = false)]
public virtual bool IsDeleted
{
get
{
return this.EntityState == EntityState.Deleted;
}
}