IIS 7.5 只允许一名用户查看网站
我有一个用 VS2010 Framework 4.0 开发的网站,发布到运行 IIS 7.5 的 Windows 2008 R2 服务器 (作为一点辅助信息 - 我有一个在 VS2005 Framework 2.0 中开发的同一站点的副本(显然,与 Framework 不同),在 Windows 2003 服务器上发布,运行完美。)
当我将 Framework 4.0 站点发布到Windows 2008 服务器,它仅适用于第一个尝试访问该站点的人。例如,我将其发布到服务器,然后使用 IE 从我的 PC 访问该网站。我旁边办公桌上的某人尝试访问该网站,但没有任何反应 - 浏览器进度条只是嘎嘎作响,无处可去 - 没有错误,服务器上没有错误,什么也没有。如果我注销并且我旁边办公桌上的人访问该网站 - 它工作正常。如果我随后尝试访问它 - 浏览器就会挂起并且无处可去。因此,只允许一个人使用该网站! (它在内联网上)。 如果当有人使用该网站时,我进入 IIS 并浏览该网站 - 它可以完美连接。
该站点有一个 global.asax,它调用一个存储过程来进行一些登录并设置 5 个会话变量。
任何想法请。它让我发疯,让我回到 VS2005 和 Framework 2.0
** 添加了下面评论中的代码**
string CurrUser = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString().Replace("\\", "/");
CPDataAccess.DataAccess da = new CPDataAccess.DataAccess();
System.Data.DataView dvGetUserCurrWP;
dvGetUserCurrWP = da.GetUserCurrWP(CurrUser);
int somerows = dvGetUserCurrWP.Count;
I have a web site developed in VS2010 Framework 4.0 published to a Windows 2008 R2 server running IIS 7.5
(As a bit of side info - I have a copy of the same site (apart, obviously, from the Framework) developed in VS2005 Framework 2.0 published on a Windows 2003 server that works perfectly.)
When I publish the Framework 4.0 site to the Windows 2008 server, it only works for the first person that tries to access the site. E.g. I publish it to the server, and then access the site from my PC using IE. Someone at the desk next to me tries to access the site and nothing happens - the browser progress bar just chuggs along going nowhere - no errors, no errors on the server, nothing. If I log out and the person at the desk next to me accesses the site - it works fine. If I then try to access it - the browser just hangs and goes nowhere. So, only one person is allowed to use this web site! (It's on an intranet).
If, while someone is using the site, I go into IIS and browse the site - it connects perfectly.
The site has a global.asax which calls a stored procedure to do some log ins and sets 5 session variables.
Any ideas please. It's driving me nuts and has caused me to go back to VS2005 and Framework 2.0
** Added code from comment below**
string CurrUser = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString().Replace("\\", "/");
CPDataAccess.DataAccess da = new CPDataAccess.DataAccess();
System.Data.DataView dvGetUserCurrWP;
dvGetUserCurrWP = da.GetUserCurrWP(CurrUser);
int somerows = dvGetUserCurrWP.Count;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查性能选项卡下的连接和带宽限制。
编辑
由于 DataView 继承自 MarshallByValueComponent,它实现了 IDisposable,请尝试为您的数据调用添加 using 语句:
Check the connection and bandwidth limits under the performance tab.
EDIT
Since the DataView inherits from MarshallByValueComponent, which implements IDisposable, try adding a using statement for your datacall: