0

Is it possible to use a connection string from a nuget package? I am working on an internal package and would like to use the connection string from the App.config instead of having each project include the connection string.

TheDizzle
  • 1,534
  • 5
  • 33
  • 76

1 Answers1

0

ConfigurationManager uses .config file from executable project. If you want read info from file which is not in your project you can’t use ConfigurationManager. You can transform projects .config file and this values will be accessible by ConfigurationManager, see links

https://learn.microsoft.com/en-us/nuget/create-packages/source-and-config-file-transformations https://haacked.com/archive/2010/11/19/nuget-transformation.aspx

Basil Kosovan
  • 888
  • 1
  • 7
  • 30