System.NullReferenceException:未将对象引用设置为对象的实例。而对象已经创建

时间:2016-01-07 12:41:28

标签: c# asp.net

我知道该问题是由于未创建的对象或null,但我在所有设置后都遇到了问题。

我已经创建了该对象,该对象正在我的本地解决方案中工作,但是当我在共享服务器上部署它时,它会给我System.NullReferenceException: Object reference not set to an instance of an object.

请提供帮助,代码如下

  TicketManagement objMyTicketDetails1 = new TicketManagement();

班级TicketManagement

 public class TicketManagement : IdName
{

    public int TicketId { get; set; }
    public string TicketNo { get; set; }
    public string Stage { get; set; }
    public string Level { get; set; }
    public int StatusId { get; set; }
    public int StageId { get; set; }
    public string SearchOnDate { get; set; }
    public DateTime PeriodTo { get; set; }
    public DateTime PeriodFrom { get; set; }
    public string TicketType { get; set; }
    public string Remarks { get; set; }
    public string Module { get; set; }
    public string ActionRemarks { get; set; }
    public string Status { get; set; }
    public int LevelId { get; set; }
    public int TicketAssignId { get; set; }
    public int ModuleId { get; set; }
    public int FK_EmployeeId { get; set; }
    public DateTime ApprovedOn { get; set; }
    public string flag { get; set; }
    public string xmldoc { get; set; }
    public string Authority { get; set; }

}

班级IdName

 public class IdName : IEntity
{

    public int RecordId { get; set; }

    public int Id { get; set; }

    public string Name { get; set; }

    public string Description { get; set; }

    public string CreatedBy { get; set; }
    public DateTime CreatedOn { get; set; }

}

InterFace IEntity

public interface IEntity
{
}

0 个答案:

没有答案