Active Directory에서 전자 메일을 받기 위해 C# 코드를 작성했습니다. 그것은 내 로컬 시스템에서 잘 작동하지만 호스팅 후 나는 이메일 주소를 얻지 못하고있다.호스팅 후 Active Directory 세부 정보가 표시되지 않음
:- 변경된 응용 프로그램 풀 ID
- 사용 Windows 및 다이제스트의 Authentications (모두 동시에 너무 하나 하나에서)
코드 NetworkService
에 - 다음은 이미 시도한 것들
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "comppany.com" , "DC=compnay,DC=com", ContextOptions.Negotiate))
// tried above and below//(ContextType.Domain, System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName))
{
// validate the credentials
bool isValid = pc.ValidateCredentials(Uid, Pwd);
if (isValid)
{
try
{
using (UserPrincipal up = UserPrincipal.FindByIdentity(pc, Uid))
{
return up != null && !String.IsNullOrEmpty(up.EmailAddress) ? up.EmailAddress : string.Empty;
}
//return "Validate successfully.";
}
catch (Exception ex)
{
return ex.Message;
}
}
}
은 또한 다음과 같은 시도
아무도 IIS7.0에서 응용 프로그램을 호스팅 한 후 작동하지 않습니다
도와주세요. 감사합니다.
원격으로 디버깅을 시도 했습니까? 아니면 로깅? – Tarec