开发者

HttpSessionState null using CassiniDev

I am trying to build some unit test using CassiniDev. First of all I create a Server and a Page and generate a request:

CassiniDevServer server = new CassiniDevServer();
server.StartServer("C:\\", 8080, "/", "localhost");
File.Delete(@"C:\Default.aspx");
File.Create(@"C:\Default.aspx");
WebClient browser = new WebClient();
browser.DownloadString(server.NormalizeUrl("Default.aspx"));

Everything is fine, but when I try to use the HttpSessionState object, it is null:

session = HttpContext.Current.Session;开发者_运维知识库

Should I do something else or additional steps?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜