Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7946079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:02:53+00:00 2026-06-04T01:02:53+00:00

I want to create a VS 2010 C# console application that connects to two

  • 0

I want to create a VS 2010 C# console application that connects to two (or more) different CRM 2011 servicecontexts / tenants. I want to be able to update data in one with data from the other.

If I create two different early bound classes with crmsvcutil I get a compiler error: “Duplicate ‘Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute’ attribute”

If I concatenate the two files, it compiles but then I get a runtime error: “A proxy type with the name account has been defined by multiple types”.

How can this be accomplished?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:02:54+00:00Added an answer on June 4, 2026 at 1:02 am

    Create a separate library project for each set of early bound classes and place one of the crmsvcutil files in each library (add assembly references as required). Now, on the console app, add references to the libraries.

    Let’s say I created two library projects that compile to Proxy1.dll and Proxy2.dll. The root namespaces for each library are Proxy1 and Proxy2. In the ConsoleApp.exe, I add the two references and the following:

    var url1 = new Uri(".../XRMServices/2011/Organization.svc");
    var proxy1 = new OrganizationServiceProxy(url1, null, null, null);
    proxy1.EnableProxyTypes(Assembly.Load("Proxy1")); // Proxy1.dll
    
    var url2 = new Uri(".../XRMServices/2011/Organization.svc");
    var proxy2 = new OrganizationServiceProxy(url2, null, null, null);
    proxy2.EnableProxyTypes(Assembly.Load("Proxy2")); // Proxy2.dll
    
    using (var context1 = new Proxy1.Proxy1ServiceContext(proxy1))
    using (var context2 = new Proxy2.Proxy2ServiceContext(proxy2))
    {
      var accounts1 = context1.AccountSet;
      var accounts2 = context2.AccountSet;
    
      foreach (var account in accounts1) Console.WriteLine("1: {0}: {1}", account.GetType(), account.Id);
      foreach (var account in accounts2) Console.WriteLine("2: {0}: {1}", account.GetType(), account.Id);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create console application in Microsoft Visual C# 2010 Express that will
I want to use this jQuery gallery more than once on my page: http://workshop.rs/2010/07/create-image-gallery-in-4-lines-of-jquery/
I am using Delphi 2010, and when I created a console application that prints
I want to create a Silverlight (Framework 4.0, C# and Visual Studio 2010) application
I want to create view that combine data from two tables, sample data in
I want to create an extension for Visual Studio 2010 that contains only a
I want to create date with specific format for e.g 03-20-2010 have a format
I am trying ebook reading app. In that I want create UIActionSheet by clicking
I'm using visual studio 2010, I want to create several OvalShapes from VB PowerPacks
I want to create a news page that includes a snippet of the latest

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.