繁体   English   中英

母羊找不到领域的KDC

[英]ews cannot find KDC for realm

我正在尝试使用.net核心在树莓派上运行以下c#代码,该代码在Windows上可以正常运行,并且完全可以实现我想要的功能。 但是在pi上,这给了我一个涉及kerberos的奇怪例外。 过去,我曾使用此pi运行其他.net核心程序。

我的代码是:

using System;
using Microsoft.Exchange.WebServices.Data;

namespace Test
{
class Program
{
    static void Main(string[] args)

    {
            // Create the binding to ews
            ExchangeService service = new ExchangeService();
            // Set the credentials for the user
            service.Credentials = new WebCredentials("user@email.com", "password");
            // Set the URL
            service.Url = new Uri("https://email.com/ews/Exchange.asmx");
            // Create a bew email
            EmailMessage email = new EmailMessage(service);
            // Set the recipiant to an email
            email.ToRecipients.Add("user@email.com");
            // Set the subject
            email.Subject = "HelloWorld";
            // Set the body
            email.Body = new MessageBody("This is the first email I've sent by using the EWS Managed API.");
            email.Send();
    }
}
}

但是,当我使用dotnet core将其发布到linux-arm并在pi上运行时,出现以下异常

Unhandled Exception: System.ComponentModel.Win32Exception: GSSAPI operation failed with error - An invalid status code was supplied (Cannot find KDC for realm "email.com").
      at System.Net.HttpWebRequest.GetResponse()
      at 
 Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.GetResponse()
  at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
  at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request)
  at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
  at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateItems(IEnumerable`1 items, FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode, ServiceErrorHandling errorHandling)
  at Microsoft.Exchange.WebServices.Data.Item.InternalCreate(FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
  at Microsoft.Exchange.WebServices.Data.EmailMessage.InternalSend(FolderId parentFolderId, MessageDisposition messageDisposition)
  at Microsoft.Exchange.WebServices.Data.EmailMessage.Send()
  at Test.Program.Main(String[] args) in V:\visual studio stuff\Test\Test\Test\Program.cs:line 23

任何帮助都会很棒

如果需要GSSApi,则应安装gss-ntlmssp ,它是Kerberos插件的软件包。 如果仍不能解决问题,请查看似乎属于您的GitHb问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM