【问题标题】:Cant run my Executable on .Net Framework 2.0无法在 .Net Framework 2.0 上运行我的可执行文件
【发布时间】:2023-03-08 14:47:01
【问题描述】:

我的问题很简单,我的应用程序在框架 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 设置?

【问题讨论】:

    标签: vb.net .net-2.0 httpwebrequest


    【解决方案1】:

    你的问题是

    ServicePointManager.SetTcpKeepAlive

    并且仅在 .NET 2.0 SP2 及更高版本中为 supported

    【讨论】:

    • 感谢您的回复,但在 Framework 2.0 中有替代方案
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-15
    • 2014-11-11
    • 2018-02-21
    • 1970-01-01
    • 2011-02-08
    • 2011-07-08
    相关资源
    最近更新 更多