Skip to content

Support for Strong Type Assembly when creating ServiceClient (.net core) #529

@GauteOA

Description

@GauteOA

Hi. I would like to be able to define what strongly type assembly the ServiceClient should use when creating it.

The issue is now, if I have an application that contains multiple early-bound entitites files (each in seperate assemblies and namespaces) from different systems (on-premise crm and dataverse) that have the same entitity, ie contact, it will throw an exception: A proxy type with the name contact has been defined by another assembly.

This is a common issue when working with multiple early-bound files from different systems, and the workaround have been using EnableProxyTypes(assembly) method on the OrganizationServiceProxy class (on-premise) where you send it what assembly it should "reflect" from.

But the ServiceClient does not have any EnableProxyTypes method or the like, and seems to automatically "reflect" all classes with the [assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute()] regardless of what assembly it resides in, when it's created.

I have tried to use the Clone method on ServiceClient, sending with the strongly type assembly, but it seems to initilize the service-client and I get the same error as above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions