473,386 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ASP.NET 2.0 With DLL config files Shadow Copy Question

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\\T emporary 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\Tempor ary ASP.NET
Files\labor.helpdesk.website\3911f8af\_shadow\6fcb c95c\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

Nov 7 '06 #1
5 3893
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("myc onfig.xml");

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ma*************@compuserve.com" wrote:
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\\T emporary 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\Tempor ary ASP.NET
Files\labor.helpdesk.website\3911f8af\_shadow\6fcb c95c\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

Nov 7 '06 #2
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.comwrote:
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("myc onfig.xml");

Peter

--
Co-founder, Eggheadcafe.com developer portal:http://www.eggheadcafe.com
UnBlog:http://petesbloggerama.blogspot.com

"mark_overstr...@compuserve.com" wrote:
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\\T emporary ASP.NET
Files\\labor.helpdesk.website\\3911f8af\\6fcbc95c\ \assembly\\dl3\\5c476dff\*\8c8190b6_9402c701\\Labo r.Helpdesk.DataLayer.DLL
.... but the config file appears in the shadow copy bin directory here
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Tempor ary ASP.NET
Files\labor.helpdesk.website\3911f8af\_shadow\6fcb c95c\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- Hide quoted text -- Show quoted text -
Nov 8 '06 #3
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ma*************@compuserve.com" wrote:
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.comwrote:
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("myc onfig.xml");

Peter

--
Co-founder, Eggheadcafe.com developer portal:http://www.eggheadcafe.com
UnBlog:http://petesbloggerama.blogspot.com

"mark_overstr...@compuserve.com" wrote:
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\\T emporary ASP.NET
Files\\labor.helpdesk.website\\3911f8af\\6fcbc95c\ \assembly\\dl3\\5c476dff\Â*\8c8190b6_9402c701\\Lab or.Helpdesk.DataLayer.DLL
.... but the config file appears in the shadow copy bin directory here
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Tempor ary ASP.NET
Files\labor.helpdesk.website\3911f8af\_shadow\6fcb c95c\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- Hide quoted text -- Show quoted text -

Nov 8 '06 #4
The original will be in:
AppDomain.CurrentDomain.SetupInformation.PrivateBi nPath
or
AppDomain.CurrentDomain.SetupInformation.Applicati onBase

Test for the right one first, then use that in your code.
HTH

Ciaran O'Donnell

"ma*************@compuserve.com" wrote:
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\\T emporary 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\Tempor ary ASP.NET
Files\labor.helpdesk.website\3911f8af\_shadow\6fcb c95c\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

Nov 8 '06 #5
Thanks. I'll try that and see if it works.

Mark

Ciaran O''Donnell wrote:
The original will be in:
AppDomain.CurrentDomain.SetupInformation.PrivateBi nPath
or
AppDomain.CurrentDomain.SetupInformation.Applicati onBase

Test for the right one first, then use that in your code.
HTH

Ciaran O'Donnell

"ma*************@compuserve.com" wrote:
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\\T emporary 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\Tempor ary ASP.NET
Files\labor.helpdesk.website\3911f8af\_shadow\6fcb c95c\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
Nov 20 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Roy | last post by:
My dll file is copied to the "%windir%\Microsoft.NET\Framework\{version}Temporary ASP.NET Files" folder when I compile my asp.net project. When I run the application. The dll under this folder is...
4
by: Barry Kelly | last post by:
I'm designing an application framework which will, amongst other things, live in an assembly hosted in the ASP.NET worker process, servicing webservice requests. Here's the scenario: APPFX is...
8
by: Subra Mallampalli | last post by:
Hi, I am trying to use <runtime> section within the web.config file. However, the contents of the <runtime> section seem to be ignored. What am i missing here? Is <runtime> section not used by...
8
by: Graham | last post by:
I noticed a similar post awhile ago and in terms of my problem it wasnt a suitable answer so I will ask again. I have VS2005 running a on development machine in my office where I do all my...
2
by: Bob | last post by:
Cannot copy assembly '<...>' to file <...>.dll'. The process cannot access the file because it is being used by another process. Could not copy temporary files to the output directory. The file...
1
by: supriya | last post by:
Hi, I found vshadow sdk in MSDN.I am unable to use the shadow copy for backup and restore because it is creating only non persistent shadow copy in winxp.How can i create persistent shadow copy...
0
by: Mark | last post by:
I have a generic data layer DLL that expects to read its connection string from it's own config file located in the same directory (works great for winforms apps). The dll and config file have...
12
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD...
13
by: jim | last post by:
Is there a way (using VB.Net or C#) to copy open or locked files? Thanks! jim
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.