Search code examples
crm

CRM Plugin Serverconnection missing reference


I am using the sample code from the crm samples that come with the sdk and this error keeps showing. How to i add this serverconnection missing reference? I am at a loss to find where it is to add it? or what namespace it belongs to?

enter image description here


Solution

  • This is a connection code for crm online I hope you serve:

    ClientCredentials Credentials = new ClientCredentials();
    Credentials.UserName.UserName = UserName;
    Credentials.UserName.Password = Password;
    Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
    Uri OrganizationUri = new Uri(Crmserverurl);
    Uri HomeRealmUri = null;
    using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null))
    {
        crmSvc = (IOrganizationService)serviceProxy;
    }