The proxy type with the account name was determined by another assembly

  • We have 2 organizations working in our onmoment crm 2011 system.
  • We created early related classes for both orgs.
  • One of our plugins throws a "proxy type error with a name that was defined by another assembly" when the account is deactivated.
  • This plugin refers only to one of the earliest linked dll libraries.

How to make the CRM system respect the namespace of these links.
I have tried several items that appear from google and nobody is working.

Since you can reproduce this using two vanilla orgies, I would see that there is something VIOLATION of the code that we can do without returning and reorganizing a bunch of code for 2 organizations.

Thanks,
John

+7
source share
5 answers

this usually means that there are one or more assemblies with the same name or method property to fix this using the fully qualified name of the assembly. For example, when using System.IO, for example, if you had a method with the same name in the code of your class that conflicts with System.IO .... you will write your fix as thisObject.System.IO.Path (- ---) = somthing for example .. does that make sense ..?

0
source

The problem is that WCF is trying to deserialize the server response and cannot determine the correct type. The best way to sort this problem is to pass the current assembly using Assembly.GetExecutingAssembly () to ProxyTypesBehavior () while creating a proxy server.

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

You may encounter this problem when referencing different assemblies containing proxy classes, i.e. one assembly wrapping the server SDK (Microsoft.Xrm.Sdk) and another assembly terminating the client SDK (Microsoft.Xrm.Sdk.Client). In such a scenario, it seems necessary to tell OrganizationServiceProxy that the assembly should be used to resolve proxy classes.

This should help:

 var credentials = new ClientCredentials(); credentials.Windows.ClientCredential = new System.Net.NetworkCredential(userName, password, domain); var proxy = new OrganizationServiceProxy(new Uri(discoveryUrl), null, credentials, null); proxy.EnableProxyTypes(typeof(CrmServiceContext).Assembly); var context = CrmServiceContext(proxy); 

It is important to call EnableProxyTypes, passing the correct assembly. I saw another solution using CrmConnection , but CrmConnection is only available in the client SDK, which means that you cannot create an instance of the "server-OrganizationServiceProxy" of this path. EnableProxyTypes (assembly assembly) works for both sides.

Hope this helps.

Regards, MH

+4
source

I found that adding Assembly.GetExecutingAssembly () solved the problem.

0
source

adding Assembly.GetExecutingAssembly () solves my problem, you also need to add using System.Reflection;

thanks

0
source

All Articles