Michael Philip's Blog

Writing about MS Tech with strong focus on Azure & CRM

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

1 Comment

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()));
}

Advertisements

One thought 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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s