Announcements
string userName = "username";
string password = @"password";
ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = userName;
credentials.UserName.Password = password;
Uri serviceUri = new Uri("https://myDomain/OrgName/XRMServices/2011/Organization.svc");
OrganizationServiceProxy proxy = new OrganizationServiceProxy(serviceUri, null, credentials, null);
proxy.EnableProxyTypes();
IOrganizationService crmService = (IOrganizationService)proxy;
var connectionString = "Url=url; Username=username; Password=password; Domain=domain; AuthType=IFD;";
var conn = new CrmServiceClient(connectionString);
You've hit a tricky and frustrating situation where the CrmServiceClient
is failing to connect in a specific WCF service project, despite working fine in others. This points to a project-specific configuration or dependency issue.
Let's systematically troubleshoot this:
1. Project-Specific Configuration Differences:
Microsoft.CrmSdk.CoreAssemblies
and Microsoft.CrmSdk.XrmTooling.CoreAssembly
NuGet packages are identical across all projects.app.config
or web.config
for any unexpected binding redirects that might be interfering with the CRM SDK.2. WCF Service-Specific Issues:
3. Dependency Conflicts:
4. Code Isolation:
CrmServiceClient
connection.CrmServiceClient
constructor to identify the exact point of failure.Troubleshooting Steps:
CrmServiceClient
constructor.By systematically working through these steps, you should be able to identify the root cause of the connection failure in your WCF service project.
André Arnaud de Cal...
293,639
Super User 2025 Season 1
Martin Dráb
232,663
Most Valuable Professional
nmaenpaa
101,158
Moderator