首页 > 解决方案 > 迁移到 Windows Server 2016 后的问题

问题描述

我正在进行从 microsoft server 2008 R2 到 microsoft server 2016 的服务器迁移。后台有一个独立的服务器来管理要在 SAS 上运行的作业。我们使用 ConcurrentDictionary 来记录作业信息。该代码在旧服务器上完美运行,但在新服务器上,作业信息从 ConcurrentDictionary 中消失。

ConcurrentDictionary 在回调函数 OnProgress 和 Oncomplete 中更新。我试图调试代码,但它不会在这两个函数中遇到断点。如果我将这些函数公开并在主 api 中添加引用,则回调无法正常工作。接下来我打算尝试使用 xml 文件而不是 ConcurrentDictionary 来存储作业信息。但我更愿意在对代码进行重大更改之前查看其他选项。

OnProgress -

   private void OnProgress(Messages.JobFeedback feedback)
    {
        operations.AddOrUpdate(feedback.JobId, 
            new SasJobsServiceOperation { Feedback = feedback },
            (id, o) => { o.Feedback = feedback; return o; });
    }

已完成 -

    private void OnCompleted(Messages.JobFeedback feedback, string xmlResult)
    { 
        operations.AddOrUpdate(feedback.JobId, 
            new SasJobsServiceOperation { Feedback = feedback, XmlResult = xmlResult },
            (id, o) => { o.Feedback = feedback; o.XmlResult = xmlResult; return o; });

    }

调用函数 -

        this.callback.OnProgress(new Messages.JobFeedback 
        {
            JobId = this.settings.Id,
            PercentComplete = 1,
            FeedbackMessage = "Starting Job on server",
            Status = Messages.StatusCode.Running
        });

标签: c#callbackwindows-server-2016concurrentdictionary

解决方案


这个问题解决了。服务器功能中禁用了“http 激活”。启用它可以使函数调用正常工作。


推荐阅读