[英]Is there a Visual Studio debugger visualizer for the ASP.NET Session?
如果是這樣的話; 我在哪里可以得到?
Peter,最好集中化會話訪問。
public class SessionStateBag
{
private static string SessionPropertyXKey = "SessionPropertyX";
public static int SessionPropertyX
{
get { return Session[SessionPropertyXKey]; }
set { Session[SessionPropertyXKey] = value; }
}
private static string SessionPropertyYKey = "SessionPropertyY";
public static string SessionPropertyY
{
get { return Session[SessionPropertyYKey]; }
set { Session[SessionPropertyYKey] = value; }
}
// etc. Try to guess the type of the session property. If you cannot guess it; use object.
}
在其余的代碼中,將Session [“ xxx”]替換為上述SessionStateBag的屬性之一。
這可能需要一兩天,但是您將所有會話都集中在一個地方,並且能夠洞察Session對象有時創建的迷宮。
您是否嘗試過Codeproject的這個工具? 在將對Microsoft.VisualStudio.DebuggerVisualizers
的引用從9.0版更正為10.0后,它可以在vs2010中使用。
安裝文件夾為:
C:\\Program files\\Microsoft Visual Studio 10.0\\Common7\\Packages\\Debugger\\Visualizers
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.