Showing results for 
Search instead for 
Did you mean: 
New Member

Common data service app.config



I am working on CDS, when I used the Console type applicaton sample code from Microsoft website, it works all well. 


But when I changed to our project which is a class library, I cannot do CreateClient() any more, it keeps checking the app.config, and telling me that section "Microsoft.CommonDataService.Connection" is missing; I don't have control to the app.config, because it is a class library project.


Has anyone run into this situation before? Any ideas/thoughts will be very much appreciated, thank you!!



Frequent Visitor

Re: Common data service app.config

Hi @jasonssis,


Where do you call the class library from? 

If the calling application has an app.config, you can put your configuration there.


Regards, Jeroen

New Member

Re: Common data service app.config

Hi Jeroen


Good morning, thank you for replying to my question.


I am writing a C# class library for other people to use, so I don't have any control on the configuration at all.


In a Console type application, both of following work all well:



var client = ConnectionSettings.Instance.CreateClient().Result;



var vs = new ConnectionSettings();

UserCredentialsSettings users = new UserCredentialsSettings();

users.ApplicationId = "xxxx";
vs.EnvironmentId = "xxxx";
vs.Tenant = "xxxx";
vs.Credentials = users;

var client2 = vs.CreateClient().Result;


I have also tried, if I changed anything in app.config file that is related to CDS, CreateClient() will not work any more; it will display configuration exception, even if I have programmatically set up everything correctly in my code. 


I am wondering, if there is anyway that we can tell CDS SDK not check this app.config when creating client. 


Thanks for any suggestions or comments,



Helpful resources


New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,342)