当 exe 位于网络上时,我的 C#.NET 应用程序运行速度变慢
当 exe 位于网络上时,我的 C#.NET 应用程序运行速度要慢得多。
我正在谈论一切,甚至图形显示也更慢。例如:当一个表单已经加载时,如果我拔掉网络电缆并最小化和最大化窗口,则需要很长时间才能重新绘制自身(无论电缆是否已插入)。
我正在使用框架.NET 3.5 SP1。
对原因有什么想法吗?
到目前为止我的假设:
- 我在构建应用程序时缺少一些选项?
- 我的公司防病毒软件会检查更多内容,因为 exe 位于网络上
- 当 exe 位于网络上时,Windows XP SP3 的缓存工作方式不同
- 服务器是 Novell 服务器:也许这确实会改变一些东西?
感谢您的帮助!
狮子座
My C#.NET application is running much slower when the exe is located on the network.
And I'm talking about everything, even the graphical dispay is slower. For example: when a form is already loaded, if I unplug my network cable and minimize and maximize the window, it takes a very long time to redraw itself (whether the cable is plugged or not).
I'm using framework .NET 3.5 SP1.
Any idea on the cause?
My hypothesis so far:
- I'm missing some options when building the app?
- my corporate antivirus checks more stuff because the exe is on the network
- the cache of Windows XP SP3 doesn't work the same way when the exe is on the network
- the server is a Novell server: maybe this does change something ?
Thanks for your help!
Leo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许是因为 CLR 需要通过网络来读取任何新程序集等?
使用一键安装程序可能会更好,其中应用程序安装在本地计算机上,但可以从中央服务器下载更新。
Perhaps because the CLR needs to go across the network to read any new assemblies, etc?
You would probably have better luck using a one-click installer, where the application is installed on the local machine but updates can be downloaded from a centralized server.
我很惊讶拔掉插头会带来不同。不过,我希望从共享运行时会出现一些差异 - 您会获得不同的安全模式,即不完全信任。在完全信任的情况下,大多数内部安全都会被简单地跳过。如果没有充分的信任,它的工作就会困难得多。 “融合”(程序集解析和加载)也必须更加努力,但是当重复您在该会话中已经完成的操作时(即加载 dll 时),这应该不是问题。
您是否考虑过将其部署(仍然部署到网络共享)为 ClickOnce (
.application
)?然后,这应该自动在本地复制并以更好的信任模型运行(并且不会影响网络性能)。I'm surprised that unplugging makes a difference. I would expect some difference running from a share, though - you get a different security mode, i.e. not full trust. In full trust most of the internal security is simply skipped. Without full trust it works a lot harder. "Fusion" (assembly resolution and loading) also will have to work harder, but this shouldn't be a problem when repeating operations you've already done once in that session (i.e. when the dlls have loaded).
Have you considered deploying (still to a network share) as ClickOnce (
.application
)? This should then copy locally automatically and run with a better trust model (and no network performance impact).