ASP .NET 重定向到另一个页面时出错:试图读取或写入受保护的内存。这通常表明其他内存已损坏

ASP .NET Error when redirect to another page: Attempted to read or write protected memory. This is often an indication that other memory is corrupt

我尝试 运行 网络,它在我登录后将我重定向到我的仪表板。数据库工作找到了。数据显示正确。但是当我试图重定向到另一个页面时,出现了这个错误:试图读取或写入受保护的内存。这通常表示其他内存已损坏。

在我朋友的电脑上正在查找。

screenshot error break

这是代码

protected void bindGvProject()
    {
        Session.Remove(GV_PROJECT);
        DataTable dt = new DataTable();

        try
        {
            using (ProjectWS.ProjectWebService ws = new ProjectWS.ProjectWebService())
            {
                ws.InsertAuditLog("Project", "Project.aspx.cs", 186, c.GetIP(), "GetProjects", CommonVariable.ACTION_RETRIEVE, loginName, DateTime.Now);
                dt = ws.GetProjects();
                Session[GV_PROJECT] = dt;
            }
        }
        catch (Exception ex)
        {
            c.LogError("Project > Project: Error on SearchProject", ex, false);
        }

        gvProject.DataSource = dt;
        gvProject.DataBind(); // error at here

        upnlSearch.Update();
        upnlSidePanel.Update();
        lbtnTotalProject.Text = dt.Rows.Count.ToString();
    }

错误堆栈:

System.AccessViolationException occurred HResult=-2147467261
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Source=System.Web
StackTrace: at System.Web.Hosting.UnsafeIISMethods.MgdGetSiteNameFromId(IntPtr pConfigSystem, UInt32 siteId, IntPtr& bstrSiteName, Int32& cchSiteName) at System.Web.Configuration.ProcessHostConfigUtils.GetSiteNameFromId(UInt32 siteId) at System.Web.Configuration.ProcessHostMapPath.MapPathCaching(String siteID, VirtualPath path) at System.Web.Configuration.ProcessHostMapPath.GetPathConfigFilenameWorker(String siteID, VirtualPath path, String& directory, String& baseName) at System.Web.Configuration.ProcessHostMapPath.System.Web.Configuration.IConfigMapPath.GetPathConfigFilename(String siteID, String path, String& directory, String& baseName) at System.Web.Configuration.HostingPreferredMapPath.GetPathConfigFilename(String siteID, String path, String& directory, String& baseName) at System.Web.Configuration.WebConfigurationHost.GetStreamName(String configPath) at System.Configuration.Internal.DelegatingConfigHost.GetStreamName(String configPath) at System.Configuration.BaseConfigurationRecord.InitConfigFromFile() at System.Configuration.BaseConfigurationRecord.Init(IInternalConfigRoot configRoot, BaseConfigurationRecord parent, String configPath, String locationSubPath) at System.Configuration.Internal.InternalConfigRoot.GetConfigRecord(String configPath) at System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Configuration.Internal.InternalConfigConfigurationFactory.System.Configuration.Internal.IInternalConfigConfigurationFactory.Create(Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Web.Configuration.WebConfigurationHost.OpenConfiguration(WebLevel webLevel, ConfigurationFileMap fileMap, VirtualPath path, String site, String locationSubPath, String server, String userName, String password, IntPtr tokenHandle) at System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(String path) at Telerik.Web.X_UA_CompatbileReader.LoadWebServerConfig(String applicationPath) at Telerik.Web.X_UA_CompatbileReader.IsEdge(HttpContext context) at Telerik.Web.UI.RenderModeBrowserAdaptor.get_Instance() at Telerik.Web.UI.RadCompositeDataBoundControl.ResolveRenderMode() at Telerik.Web.UI.RadCompositeDataBoundControl.get_ResolvedRenderMode() at Telerik.Web.UI.RadGrid.get_GroupPanelPosition() at Telerik.Web.UI.RadGrid.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.RadGrid.DataBind() at Project.bindGvProject() in c:\Users\firga\Desktop\Nimrod\EMS\project\project.aspx.cs:line 291
InnerException:

我尝试 运行 我的应用程序而不输入我的 windows 10 pro 密钥(所以我 运行 windows 10 home)成功了。错误消失了。可能是我的 windows 更新出了问题,否则。