0

I have one application already on system. And creating another process (Independent Class library) to perform some other work.

If I have path of AppConfig file of my main application. How we can read connection string from another application?

string configFile = @"C:\Application\App.config";

string sqlConnectionString = ...;
SqlConnection conn = new SqlConnection(sqlConnectionString);
conn.Open();

ConfigurationManager will not work here I guess.

Tech Yogesh
  • 427
  • 4
  • 18
  • 1
    Try this : https://stackoverflow.com/questions/4738/using-configurationmanager-to-load-config-from-an-arbitrary-location – vernou Nov 27 '20 at 12:08
  • 1
    [ConfigurationManager.OpenExeConfiguration](https://learn.microsoft.com/en-us/dotnet/api/system.configuration.configurationmanager.openexeconfiguration?view=dotnet-plat-ext-5.0#System_Configuration_ConfigurationManager_OpenExeConfiguration_System_String_) – user2250152 Nov 27 '20 at 12:10

0 Answers0