【问题标题】:ASP.NET Site, error when publish [duplicate]ASP.NET 站点,发布时出错 [重复]
【发布时间】:2011-05-07 02:48:15
【问题描述】:

可能重复:
NullReferenceException when running published website in IIS

在 IIS 7.5 2008 服务器上发布我的网站时遇到问题。在我的本地电脑中,它位于 D:\projects\visual_studio\site,然后当我发布到服务器时,在 C:/sites/mysite a 中我收到以下错误消息:

[NullReferenceException:对象引用未设置为对象的实例。] D:\projects\visual_studio\site\Site1.Master.cs:67 中的 Inovação.Site1.Login1_Authenticate(Object sender, AuthenticateEventArgs e) System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +108 ....

我在我的 MasterPage 中使用了登录控件。如果我的项目在 C:/sites/mysite (服务器)中发布,为什么该位置仍指向 D:\projects\visual_studio\site\Site1.Master (本地电脑)?

【问题讨论】:

    标签: .net asp.net master-pages nullreferenceexception


    【解决方案1】:

    试试这个:

    1. 在 IIS 中单击您的站点
    2. 打开页面和控件部分
    3. 找到 ViewState 组并检查 ViewState 是否启用。

    这样的解决方案帮助我解决了发布后的空引用异常问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-23
      • 2018-08-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-25
      • 1970-01-01
      • 1970-01-01
      • 2017-12-25
      相关资源
      最近更新 更多