web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Common data service ap...
Power Apps
Unanswered

Common data service app.config

(0) ShareShare
ReportReport
Posted on by 2

Hi, 

 

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!!

 

Jason

Categories:
I have the same question (0)
  • JL-18061441-1 Profile Picture
    17 on at

    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

  • jasonssis Profile Picture
    2 on at

    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:

     

    1.

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

     

    2. 

    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,

     

    Jason

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 462

#2
WarrenBelz Profile Picture

WarrenBelz 425 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 291

Last 30 days Overall leaderboard