Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 137182

Blog Post: Error: Proxy type with the name account has been defined by another assembly

$
0
0

I am a big fan of the Simplified Connection technology added by the Xrm.Client assembly and use it almost exclusively.

Recently, I ran into the same issue at two separate customers. Both had just converted from CRM 4.0 and both had plugins and custom ASP.NET web pages in use.

Occasionally, the following exception would be encountered in either the custom ASP.NET pages or within the plugins:

A proxy type with the name account has been defined by another assembly.

Current type: Account, MyAssembly, Version=1.0.0.4, Culture=neutral, PublicKeyToken=be9afbacb707a086,

Existing type: Account, CustomPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

Parameter name: account”

The solution was quite simple:

When creating your connection:

var connection = CrmConnection.Parse(connectionString);

set the ProxyTypesAssembly property:

connection.ProxyTypesAssembly = Assembly.GetExecutingAssembly();

That will instruct .NET to use the executing application as the source for Dynamics CRM proxy types.

I hope that saves you some time.


Viewing all articles
Browse latest Browse all 137182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>