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 []:

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

I typed in for North American and this is the error I received.

Enter a CRM server name and port []:
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.'.
The remote name could not be resolved: ''
Press <Enter> to exit.

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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

It looks like the disco is assumed.
teknovationAuthor Commented:
i tried that it still fails
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.


 // 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;

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
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.