web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Metadata contains a reference that cannot be resolved: 'https://adfs.hostname.com/adfs/services/trust/mex'.

(0) ShareShare
ReportReport
Posted on by 133

Hi

Having issue on connecting to my environment in my console app.

Metadata contains a reference that cannot be resolved: 'adfs.hostname.com/.../mex'.

Anyone knows how to resolve this? Thanks.

*This post is locked for comments

I have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at

    The first things I'd check are:

    1. Can you browse to the metadata url that you get in the error message ? If not, the CRM ADFS configuration may be incorrect, or you may have firewall or other connectivity issues
    2. Check the event log on the ADFS server (ADFS creates a separate log rather than using the Application log) to see if it has any useful errors

    It's also worth checking if you can connect programmatically using other tools. I'd suggest using XrmToolbox. If you can connect, it indicates an issue in your code, whereas if you can't, then it's more likely to be an ADFS or CRM ADFS configuration issue

  • Euclides Pelisco Jr Profile Picture
    133 on at

    Hi David. Thank you for the tips.

    I tried to connect using xrmtoolbox and it worked.

    I used this code to establish connection. This code works to my trial environment. But when I tried to connect to our environment with adfs setup, connection error pops up. Do you have any idea what I missed in the code connecting to environment with adfs setup?

    Service-Code.png

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at

    Hi

    For your credentials part, could you try with the following

    var _credentials = new ClientCredentials();

    _credentials.Windows.ClientCredential.Domain = "domainname";

    _credentials.Windows.ClientCredential.UserName = "username";

    _credentials.Windows.ClientCredential.Password = "pw";

    And TLS12 setting is not necessary for CRM 2016.

  • Verified answer
    Euclides Pelisco Jr Profile Picture
    133 on at

    The issue is now fixed. According to some suggestions on my research.

    I just tried to update .NET framework to 4.6 and Microsoft.CrmSdk.CoreAssemblies to 9.0.0.7

  • Euclides Pelisco Jr Profile Picture
    133 on at

    Hi guys.

    Thank you for taking time to check my inquiry.

    The issue is now fixed. According to some suggestions on my research.

    I just tried to update .NET framework to 4.6 and Microsoft.CrmSdk.CoreAssemblies to 9.0.0.7

  • Community Member Profile Picture
    on at

    Hi, Can you tell me how you resolved this issue as I'm running into the same problem.  Thanks.

  • Community Member Profile Picture
    on at

    update to the new version of .net 9.0.0.7, in new update this problem has been solved,i suggest you to use xrm tool .

  • Community Member Profile Picture
    on at

    Thanks for the response.  I updated to 9.0.2.12, which is the latest version, but still getting the same error.  Think I figured it out.  The top level SSL certificate needs to be installed on our servers.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans