In the below code I am getting two errors at orgServiceManagement, newtoken
IServiceManagement<IOrganizationService> orgServiceManagement =ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri(""));
AuthenticationCredentials authCredentials = new AuthenticationCredentials();
authCredentials.ClientCredentials.UserName.UserName = "";
authCredentials.ClientCredentials.UserName.Password = "";
AuthenticationCredentials newtoken = orgServiceManagement.Authenticate(authCredentials);
OrganizationServiceProxy oproxy = new OrganizationServiceProxy(orgServiceManagement, newtoken);
oproxy.EnableProxyTypes();
IOrganizationService service = (IOrganizationService)oproxy;
return service;
Argument 1: cannot convert from 'Microsoft.Xrm.Sdk.Client.IServiceManagement<Microsoft.Xrm.Sdk.IOrganizationService>' to 'Microsoft.Xrm.Sdk.Client.IServiceConfiguration<Microsoft.Xrm.Sdk.IOrganizationService>'
Argument 2: cannot convert from 'Microsoft.Xrm.Sdk.Client.AuthenticationCredentials' to 'Microsoft.Xrm.Sdk.Client.SecurityTokenResponse'.
these are two errors, I am getting.
Please let me know if some has a solution or any other alternate code to create instance for IOrganizationService
Thanks in Advance.