R
Rastko Soskic
I've posted this question earlier in framework group but had no luck with
answer... So I'd try here.
Any help/advice is appreciated. Thanks in advance.
In solution for now I have two projects.
1. I have dll project and dll project HAS its App.config (dll project is
middle tier)
there is for example:
class ObjectInDll
{
SqlConnection conn;
public ObjectInDll( )
{
conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["connString"].ConnectionString;
// THERE IS connection string element with "connString" name in
Dll's config file
}
}
2. I have web site and web site has its web.config.
3. In page class Default.aspx.cs (let it be in Page_Load event)
ObjectInDll oid = new ObjectInDll();
// creation of ObjectInDll throws exception because THERE IS NO
connection string element with "connString" name within web.config.
So, my question is ( although I've solved problem by including Settings via
property page of dll project so I abandoned storing connection string in
config file)
*** How to solve this, if it is possible, without inclusion of Settings, or
if including Settings is good solution I can stop breaking my mind )) (How
to make ConfigurationManager to read proper config file and not first he
steps on? because .NET stops searching for config file when it finds first
one, and web.config is first ) ***
answer... So I'd try here.
Any help/advice is appreciated. Thanks in advance.
In solution for now I have two projects.
1. I have dll project and dll project HAS its App.config (dll project is
middle tier)
there is for example:
class ObjectInDll
{
SqlConnection conn;
public ObjectInDll( )
{
conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["connString"].ConnectionString;
// THERE IS connection string element with "connString" name in
Dll's config file
}
}
2. I have web site and web site has its web.config.
3. In page class Default.aspx.cs (let it be in Page_Load event)
ObjectInDll oid = new ObjectInDll();
// creation of ObjectInDll throws exception because THERE IS NO
connection string element with "connString" name within web.config.
So, my question is ( although I've solved problem by including Settings via
property page of dll project so I abandoned storing connection string in
config file)
*** How to solve this, if it is possible, without inclusion of Settings, or
if including Settings is good solution I can stop breaking my mind )) (How
to make ConfigurationManager to read proper config file and not first he
steps on? because .NET stops searching for config file when it finds first
one, and web.config is first ) ***