This is really not a C# language group question but rather an asp.net group
question. However, if you keep your config file in the root of the web app,
wny can't you do something like
System.Web.HttpContext.Current.Server.MapPath("myconfig.xml");
Peter

Signature
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
> I have a generic data layer DLL that expects to read its connection
> string from it's own config file. The dll and config file have been
[quoted text clipped - 19 lines]
> Thanks
> Mark
mark_overstreet@compuserve.com - 08 Nov 2006 12:29 GMT
Sorry for posting this in the wrong group but thanks for the response.
I can't do this because ...
1) It is a generic DLL that may be used with any type of project
including a Winforms so I may not have access to an HTTPContext object.
2) The DLL currently expects to load the config file from the same
directory the DLL is located and I'd like for that to continue to work
across project types (Winforms, Web, etc)
Any other ideas or do I need to take this to the ASP.NET group?
Thanks again.
Mark
On Nov 7, 5:32 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.nospammin.com> wrote:
> This is really not a C# language group question but rather an asp.net group
> question. However, if you keep your config file in the root of the web app,
[quoted text clipped - 32 lines]
> > Thanks
> > Mark- Hide quoted text -- Show quoted text -
Peter Bromberg [C# MVP] - 08 Nov 2006 14:08 GMT
suggest you download the Web Application Project add-in and convert your
project to a WAP project Then your Assembly will always be in the /bin folder.
Peter

Signature
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
> Sorry for posting this in the wrong group but thanks for the response.
> I can't do this because ...
[quoted text clipped - 50 lines]
> > > Thanks
> > > Mark- Hide quoted text -- Show quoted text -
The original will be in:
AppDomain.CurrentDomain.SetupInformation.PrivateBinPath
or
AppDomain.CurrentDomain.SetupInformation.ApplicationBase
Test for the right one first, then use that in your code.
HTH
Ciaran O'Donnell
> I have a generic data layer DLL that expects to read its connection
> string from it's own config file. The dll and config file have been
[quoted text clipped - 19 lines]
> Thanks
> Mark
Mark - 20 Nov 2006 20:20 GMT
Thanks. I'll try that and see if it works.
Mark
> The original will be in:
> AppDomain.CurrentDomain.SetupInformation.PrivateBinPath
[quoted text clipped - 30 lines]
> > Thanks
> > Mark