C# IIS7-对象引用未设置为对象实例

C# IIS7-对象引用未设置为对象实例,c#,C#,我有一个网站,每当我导航到default.aspx页面之外时,就会出现以下错误 我的问题是,当我通过VS08在调试模式下运行时,我没有得到错误,当我在运行IIS6的Web服务器上运行代码时,我没有得到错误。然而,当我在我的开发箱上针对IIS7运行我的站点时,我得到以下错误。此外,我正在用C:\inetpub\wwwroot运行IIS7站点。因此,我不知道如何在我的C:\Users\文件夹中获得错误。最后,get_profile()方法在我的代码中已经不存在超过2周了 我尝试在删除.dll后重建解

我有一个网站,每当我导航到default.aspx页面之外时,就会出现以下错误

我的问题是,当我通过VS08在调试模式下运行时,我没有得到错误,当我在运行IIS6的Web服务器上运行代码时,我没有得到错误。然而,当我在我的开发箱上针对IIS7运行我的站点时,我得到以下错误。此外,我正在用C:\inetpub\wwwroot运行IIS7站点。因此,我不知道如何在我的C:\Users\文件夹中获得错误。最后,get_profile()方法在我的代码中已经不存在超过2周了

我尝试在删除.dll后重建解决方案,我已清除IIS7s应用程序池,重新启动它,重新启动计算机,并从开发文件夹中删除了整个文件夹内容5次。没有修复此错误。我需要做什么

[NullReferenceException: Object reference not set to an instance of an object.]
   UserSession.get_profile() in C:\Users\<LocalUser>\Documents\Visual Studio 2008\Projects\Website\Website\App_Code\UserSession.cs:20
   UserSession.Log() in C:\Users\<LocalUser>\Documents\Visual Studio 2008\Projects\Website\Website\App_Code\UserSession.cs:83
   Website.MasterPages.Master.Page_Load(Object sender, EventArgs e) in C:\Users\<LocalUser>\Documents\Visual Studio 2008\Projects\Website\Website\MasterPages\Master.Master.cs:23
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
[NullReferenceException:对象引用未设置为对象的实例。]
UserSession.get\u profile()在C:\Users\\Documents\Visual Studio 2008\Projects\Website\Website\App\u Code\UserSession.cs:20中
C:\Users\\Documents\Visual Studio 2008\Projects\Website\Website\App\u Code\UserSession.cs:83中的UserSession.Log()
在C:\Users\\Documents\Visual Studio 2008\Projects\Website\Website\MasterPages\Master.Page\u加载(对象发送方,事件参数e):23
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,对象o,对象t,事件参数e)+14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(对象发送方,EventArgs e)+35
System.Web.UI.Control.OnLoad(EventArgs e)+99
System.Web.UI.Control.LoadRecursive()+50
System.Web.UI.Control.LoadRecursive()+141
System.Web.UI.Control.LoadRecursive()+141
System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)+627

尝试清除临时文件

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v4.0.30128\Temporary ASP.NET Files

和重建。

尝试清除临时文件

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v4.0.30128\Temporary ASP.NET Files

还有重建。

我试过了,但没有成功。我甚至替换了我IIS7网站目录中的所有文件。我试过了,但没有成功。我甚至替换了IIS7网站目录中的所有文件。