Jimmy D
Jimmy D

Reputation: 5376

Missing app.config file?

I just inherited a VB.Net application that gets a SQL connection string like this:

Dim m_GMSConnString As String = System.Configuration.ConfigurationSettings.AppSettings("connString")

But there's no app.config file in the solution/project. So where is it reading from?

EDIT: If this is a DLL project and the DLL is then referenced by a website project, will the DLL read from the web.config of the website project? That's the only explanation I can come up with.

Upvotes: 0

Views: 1558

Answers (2)

Chris
Chris

Reputation: 8647

EDIT: If this is a DLL project and the DLL is then referenced by a website project, will the DLL read from the web.config of the website project? That's the only explanation I can come up with.

From my experience (and it is confirmed here Why wont my application read my MyApplication.dll.config file?) answer is yes, the code will only read the app.config of the main project (or web.config in your case).

But the answer also provides link that show how to use multiple config file. I think you can tell your program to read some part from external file (your dll.config file in your case).

Upvotes: 1

Fred
Fred

Reputation: 1234

if I remember correct, there is a config file with the same name as the exe file but add the extention of .config, such as yourprog.exe.config

Upvotes: 0

Related Questions