CRM 2011 Online

Apr 18, 2012 at 4:48 PM

I made some changes to your solution for it to work with 2011 Online. Might not be the best, but it works!

I added crmservicehelpers.cs and deviceidmanager.cs from the 2011 SDK.

In Program.cs, just before ModelGenerator, I added:

ServerConnection serverConnect = new ServerConnection();

ServerConnection.Configuration config = serverConnect.GetServerConfiguration();

I then added a third parameter to ModelGenerator:  config

I commented out your setting of _orgService = ....

and replaced with:

using (_serviceProxy = new OrganizationServiceProxy(serverConfig,OrganizationUri, servierConfig.HomeRealmUri, serverConfig.Credientials, serverConfig.DeviceCreditials))

{

      _serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviours.Add(new ProxyTypesBehaviour());

     _orgService = (IOrganizationServier)_serviceProxy;

}

I also added private OrganizationServiceProxy _serviceProxy;

You have to resolve some other references like adding System.DirectoryServices.AccountManagement but you will get there eventually.  Then this code works for CRM Online as well.  Nice tool... thanks

 



Coordinator
Apr 20, 2012 at 2:24 PM

Great, thanks!