2011-05-07 203 views
0

可能重複時:
NullReferenceException when running published website in IISASP.NET網站,錯誤發佈

我有問題時,發佈我的網站在IIS 7.5 2008服務器。在我的本地PC中,它位於D:\ projects \ visual_studio \ site,然後當我發佈到服務器時,在C:/ sites/mysite ai中獲取此錯誤消息:

[NullReferenceException:Object reference not set to D:\ projects \ visual_studio \ site \ Site1.Master.cs中的Inovação.Site1.Login1_Authenticate(Object sender,AuthenticateEventArgs e):67 System.Web.UI.WebControls.Login.OnAuthenticate AuthenticateEventArgs e)+108 ....

我在我的母版頁中使用登錄控件。如果我的項目在C:/ sites/mysite(服務器)中發佈,爲什麼位置仍指向D:\ projects \ visual_studio \ site \ Site1.Master(本地pc)?

回答

0

試試這個:

  1. 點擊您的網站在IIS
  2. 打開頁面和控件部分
  3. 發現的ViewState組,檢查是否啓用了ViewState的。

這樣的解決方案幫助我解決了發佈後的空引用異常問題。