I have a WCF service (AIF) on Microsoft Dynamics AX
I can call it without any problem using .NET 4.6.1
. However, when I run the same exact code using .NET Core
I get an error which states
A call to SSPI failed The target principal name is incorrect
There are many alike questions out there about this error but the solutions does not fix my problem.
var service = new MarketplaceGetItemsDataServiceClient();
service.ClientCredentials.Windows.ClientCredential.UserName = "UserName";
service.ClientCredentials.Windows.ClientCredential.Password = "P@ssword";
service.ClientCredentials.Windows.ClientCredential.Domain = "Domain";
var result = service.GetItemsDataAsync(new CallContext(), new SearchOptionsDC() { VendorId = "0000" }).Result;