堆栈追踪:
[NullReferenceException: Object reference not set to an instance of an object.
**StartupMilestones.Site.Page_Load(Object sender, EventArgs e) in
C:\inetpub\wwwroot\StartupMilestones\StartupMilestones\Site.Master.vb:8**
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, _
Boolean includeStagesAfterAsyncPoint) +2207
我似乎无法弄清楚为什么我会收到NullReferenceException。以下是截至目前我在Site.Master.vb中唯一的代码:
Public Class Site
Inherits System.Web.UI.MasterPage
Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Dim lbluserid As New Label
lbluserid.Text = "YO!"
End Sub
End Class
奇怪的是,堆栈跟踪在此位置引用第8行:**C:\inetpub\wwwroot\StartupMilestones\StartupMilestones\Site.Master.vb:8**
,而VS中的文件在“属性”窗口中显示C:\Working Projects\StartUpMilestones\DEV\Site.Master.vb
。有什么不妥?谢谢!
答案 0 :(得分:0)
您需要更新IIS中虚拟目录使用的物理位置,如下所示:
对于IIS7:
有关详细信息,请参阅Change the Physical Path of Virtual Directory Content (IIS 7)。