无法在 .Net Framework 2.0 上运行我的可执行文件

发布于 2024-11-13 12:38:50 字数 578 浏览 3 评论 0原文

我的问题很简单,我的应用程序在框架 2.0 下完美执行,但最近我升级了代码以添加几行。

        ServicePointManager.DnsRefreshTimeout = 500
        ServicePointManager.DefaultConnectionLimit = 100
        ServicePointManager.EnableDnsRoundRobin = False
        ServicePointManager.MaxServicePointIdleTime = 1000
        ServicePointManager.SetTcpKeepAlive(False, 500, 500)

现在,当我评论这些时,应用程序可以完美地执行,但是当包含的程序需要 Framework 2.0 SP2 升级时,我在 MSDN 中搜索了这一点,但看起来这可以从 Framework 1.1 获得,

我不希望我的用户因为这样的小事情而升级到 SP2,但是也无法从我的代码中删除它,是否有替代方法可以在不升级框架的情况下实现类似的 ServicePointManager 设置?

My problem is simple I have my application which was perfectly executing under framework 2.0, but recently I upgraded my code to add few lines.

        ServicePointManager.DnsRefreshTimeout = 500
        ServicePointManager.DefaultConnectionLimit = 100
        ServicePointManager.EnableDnsRoundRobin = False
        ServicePointManager.MaxServicePointIdleTime = 1000
        ServicePointManager.SetTcpKeepAlive(False, 500, 500)

Now when I comment these, the application is executed flawlessly, but when included program requires Framework 2.0 SP2 upgrade, I searched MSDN for this but looks like this is available from Framework 1.1

I dont want my users to upgrage to SP2 for such minor things but cant also remove this from my code, Is there an alternate to achieve similar ServicePointManager settings without a Framework Upgrade?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

平生欢 2024-11-20 12:38:50

你的问题线是

ServicePointManager.SetTcpKeepAlive

且仅在 . NET 2.0 SP2 及更高版本。

Your problem line is

ServicePointManager.SetTcpKeepAlive

and is supported only in .NET 2.0 SP2 and up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文