Error when running this program for Dynamic CRM

I ran the Sample Code for Business Management and was prompted

I was prompted this:
Enter a CRM server name and port [crm.dynamics.com]:

Where can I find this info? Where can I find the port?

I typed in disco.crm.dynamics.com for North American and this is the error I received.

Enter a CRM server name and port [crm.dynamics.com]: disco.crm.dynamics.com
Is this organization provisioned in Microsoft Office 365 (y/n) [y]: y
The application terminated with an error.
Metadata contains a reference that cannot be resolved: 'https://disco.disco.crm.
dynamics.com/XRMServices/2011/Discovery.svc?wsdl&sdkversion=7.1'.
The remote name could not be resolved: 'disco.disco.crm.dynamics.com'
Press <Enter> to exit.

Open in new window


Reference:
https://msdn.microsoft.com/en-us/library/gg334689.aspx
teknovationAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Feridun KadirPrincipal ConsultantCommented:
Try just CRM.dynamics.com

It looks like the disco is assumed.
0
teknovationAuthor Commented:
i tried that it still fails
0
teknovationAuthor Commented:
Found the solution:

The problem is the authentication process. I debugged the code and find out that SDK samples are using  the following code to the username.

The value of "UserPrincipal.Current.UserPrincipalName" is always null and hence the error message. This code sits in CrmServiceHelpers.cs.
If we comment out the above mentioned code. The system will prompt you to enter your username and password and you are good to go.
You will receive the similar error message if you are trying to use developer’s toolkit with CRM Online on Office 365.The exact message is “Value Can not be null”. Here is the screen shot.

Reference: http://mscrmshop.blogspot.in/2012/09/error-message-on-running-sdk-samples.html

 // For OnlineFederation environments, initially try to authenticate with the current UserPrincipalName
                    // for single sign-on scenario.
                   /* else if (config.EndpointType == AuthenticationProviderType.OnlineFederation
                        && config.AuthFailureCount == 0
                        && !String.IsNullOrWhiteSpace(UserPrincipal.Current.UserPrincipalName))
                    {
                        config.UserPrincipalName = UserPrincipal.Current.UserPrincipalName;
                        return null;
                    }*/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
teknovationAuthor Commented:
no one answered my thread correctly
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Dynamics

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.