Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / November 2006

Tip: Looking for answers? Try searching our database.

ASP.NET 2.0 With DLL config files Shadow Copy Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mark_overstreet@compuserve.com - 07 Nov 2006 17:49 GMT
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
placed in the bin directory (VS.NET2005).  However, due to shadow
copying, the config file does not get placed in the same directory as
the executing assembly at execution time.

For example, my data access DLL was copied to the following location
...

C:\\WINNT\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET
Files\\labor.helpdesk.website\\3911f8af\\6fcbc95c\\assembly\\dl3\\5c476dff\\8c8190b6_9402c701\\Labor.Helpdesk.DataLayer.DLL

... but the config file appears in the shadow copy bin directory here

C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\labor.helpdesk.website\3911f8af\_shadow\6fcbc95c\bin\17

So my question is how can I ready the .config file from my data access
DLL (Labor.Helpdesk.DataLayer.DLL) if the files are in two physical
locations?  

Thanks
Mark
Peter Bromberg [C# MVP] - 07 Nov 2006 22:32 GMT
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 -
Ciaran O''Donnell - 08 Nov 2006 15:49 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.