Skip to main content

Notifications

Announcements

No record found.

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 131

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Metadata contains a reference that cannot be resolved: 'https://adfs.hostname.com/adfs/services/trust/mex'.

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Metadata contains a reference that cannot be resolved: 'https://adfs.hostname.com/adfs/services/trust/mex'.

    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
    Community Member Microsoft Employee on at
    RE: Metadata contains a reference that cannot be resolved: 'https://adfs.hostname.com/adfs/services/trust/mex'.

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

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

    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

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

    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

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Metadata contains a reference that cannot be resolved: 'https://adfs.hostname.com/adfs/services/trust/mex'.

    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.

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

    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

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Metadata contains a reference that cannot be resolved: 'https://adfs.hostname.com/adfs/services/trust/mex'.

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,472 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,560 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans