我有一个可以安装插件的 Web 应用程序。为了创建这些插件,我创建了一个具有相同结构的新 Web 应用程序,并从主应用程序中引用程序集。
在此之后,我只将 aspx(标记)文件复制到主应用程序,所以我有标记页面和对程序集的引用,以便我可以调试。
到目前为止,这一切都运行良好,直到我进行修改时,自上次工作以来唯一改变的是安装 VS2010 SP1。
现在代码中有一点 - 我无法确切地看到它在外部代码中发生的位置,但是会话 ID 正在更改并且我在会话中丢失了所有内容。
我有一段代码可以打开一个带有报告的新窗口:
string link = String.Format( "window.open('{0}');", Page.ResolveUrl( "~/CustomPages/BudgetOnlineMedia.aspx" ) );
Page.ClientScript.RegisterStartupScript( this.GetType(), "MedReport", link, true );
在此之后,在基本页面中遇到断点:
/// <summary>
/// OnPreload
/// </summary>
/// <param name="e">args</param>
[VersionChange( "7.3.88.272", "13/04/2011", "Fully qualified path to login page" )]
protected override void OnPreLoad( EventArgs e )
{
try
{
base.OnPreLoad( e );
if ( base.CurrentUser == null )
{
Response.Redirect( "~/Pages/Login.aspx", false );
}
}
catch ( Exception ex )
{
ErrorLogging.LogError( ex );
}
}
再次命中相同的断点,但这次 SessionID 已更改!
此时我可以读取调用堆栈,但我的代码中没有任何内容可以更改会话。
堆栈跟踪如下所示:
> Web.WAP.Objects.DLL!Web.WAP.Objects.Controls.UserPresencePage.OnPreLoad(System.EventArgs e) Line 28 C#
System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint) + 0x22b bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint) + 0x84 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x51 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext context) + 0x16 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0x32 bytes
App_Web_-ti4sydr.dll!ASP.custompages_budgetexhibition_aspx.ProcessRequest(System.Web.HttpContext context) + 0x33 bytes C#
System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0xb6 bytes
System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step, ref bool completedSynchronously) + 0x4c bytes
System.Web.dll!System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(System.Exception error) + 0x133 bytes
System.Web.dll!System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) + 0x7c bytes
System.Web.dll!System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest wr) + 0x17c bytes
System.Web.dll!System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest wr) + 0x63 bytes
System.Web.dll!System.Web.HttpRuntime.ProcessRequest(System.Web.HttpWorkerRequest wr) + 0x47 bytes
WebDev.WebHost20.dll!Microsoft.VisualStudio.WebHost.Request.Process() + 0x177 bytes
WebDev.WebHost20.dll!Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Microsoft.VisualStudio.WebHost.Connection conn) + 0x6c bytes
[Appdomain Transition]
WebDev.WebHost20.dll!Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(object acceptedSocket) + 0xd3 bytes
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(object state) + 0x2f bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6f bytes
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback tpWaitCallBack) + 0x53 bytes
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(object state) + 0x59 bytes
什么是【应用领域过渡】?
你能看到任何会导致会话 ID 改变的东西吗!?
编辑:
好的,这可能与 VS SP1 无关,而是与 IE10 预览有关。
现在当我做一个window.ShowModalDialog 时,然后从那个对话框中打开一个window.open。Internet Explorer 创建一个新会话