0

When an application is referring to the configuration of another project, all the values in the appsettings tag returning null values. Please let me know there is anything to add in the code to read the values(key values from appsetting tag) from the configuration file from another project.

Jagadesh
  • 264
  • 6
  • 16
  • 1
    What do you mean by "another project"? Any application instance should have the `App.config` or `Web.config` which was deployed with that application. What is in your config file and how are you trying to read it? – David Sep 11 '14 at 13:29
  • Project A is referring the project B dll. Project A instance is trying to read the values of the configuration file of project B. Values are key values from appsettings. – Jagadesh Sep 11 '14 at 13:37
  • If Project A is the application, it has a config file (or can have one, anyway). If Project B is a class library, it shouldn't have a config file. *Applications* are configured, *libraries* are not. You can keep an `App.config` in a class library, but it's going to take some (potentially ugly and difficult to maintain) work for applications to use it. – David Sep 11 '14 at 13:39
  • @David The problem i described and your understanding is correct. The problem is instance of A is not reading the B config file. – Jagadesh Sep 11 '14 at 13:48
  • The problem is that B shouldn't have a config file. The configuration options used by the *application* should be in the *application's* config file. – David Sep 11 '14 at 13:49

1 Answers1

1

You cannot do this out of the box. Your options are:

Community
  • 1
  • 1
oleksii
  • 35,458
  • 16
  • 93
  • 163