How to solve : A proxy type with the name account has been defined by another assembly

The problem is actually with WCF attempting to deserialize the server response and not being able to identify the correct type. The best method to sort this issue is to pass in the current assembly using Assembly.GetExecutingAssembly() to the ProxyTypesBehavior() while creating the proxy like so

using (serviceProxy = new OrganizationServiceProxy(config.OrganizationUri,
config.HomeRealmUri,
config.Credentials,
config.DeviceCredentials))
{
// This statement is required to enable early-bound type support.
serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior(Assembly.GetExecutingAssembly()));
}

2 thoughts on “How to solve : A proxy type with the name account has been defined by another assembly”

  1. This looks good, but I am attempting to use it with CRM 16 (365 online), and it seems that the SDK assemblies have changed, the CurrentServiceEndpoint proprty has an EndPointBehaviors property which when I try to pass it the Assembly.GetExecutingAssembly(), it is not there, do you have a solution for the new version?

Leave a Reply

Your email address will not be published. Required fields are marked *