fbpx

App.config

More
1 year 7 months ago #1 by Boonnam S
App.config was created by Boonnam S
A quick question regarding X# and WPF. Does X# uses App.config?

A background on why I asked that question. Since "Ado.NET Entity Data Model" isn't available for X#, I decided to create a class library for Entity Framework in C#. In order to consume my dll, I must set the connectionString in App.config. During a build I get an error, XS1936. The location of the error tell me I am missing the connectionString in App.config. I ran into similar issue in C#, but once I updated my App.config, it works.

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago #2 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic App.config
Hi,

the use of the App.config is a runtime story. I don't know of the project system of X# supports it, but if class libraries you use make use also of the App.config, it is required.

It is possible to "live" also without App.config, and sometimes it is required, specially when you are using the functionality in a DLL and not in the executable itself (I had this issue with the Google AdWords library and it was a bit of research and work).

Wolfgang

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago #3 by Robert van der Hulst
Replied by Robert van der Hulst on topic App.config
Hi,

App.config is fully supported by X#. You can manually add an app.config or use the Settings tab page of the Project Properties. That tab page will create a Settings class and will also create and maintain the App.config.
In the settings editor you can choose whether you want an internal settings class or a public settings class (combo box on the toolbar).
If you open the Settings tab for a project that already has a app.config then the page will
be filled with the existing entries from app.config.

Also during the build process the app.config will be copied to the output folder as myapp.exe.config


Robert

XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago #4 by Boonnam S
Replied by Boonnam S on topic App.config
Thank you, Robert and Wolfgang for the quick reply. It turn out I was missing "using System.Linq". I gotten so used to that line automatically being inserted when I create WPF and Winform under C#, but for X# that is not the case, but it is automatically inserted for X# console application. Sorry for the confusion.

Boonnam

Please Log in or Create an account to join the conversation.