web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to resolve Error on creating IOrganizationService Instance

(0) ShareShare
ReportReport
Posted on by 8

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.

I have the same question (0)
  • Suggested answer
    Tarcisio Vilas Boas Profile Picture
    on at

    Hey Phanikumar,

    Please, try to follow this sample using CrmSericeClient: docs.microsoft.com/.../sample-simplified-connection-quick-start.

    Following this sample, you will be able to create a connection to D365.

    Hope this helps you.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 57 Super User 2026 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 26

#3
CU07021359-0 Profile Picture

CU07021359-0 23 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans