Groups > Asp .Net > ASP.NET Installation and setup > Use a Name/value in Machine.config file in the web.config file




Use a Name/value in Machine.config file in the web.config
file

Use a Name/value in Machine.config file in the web.config file
Thu, 27 Mar 2008 16:08:05 +000
Hello.

I want/need to access a variable in the machine.config file and use it in the
web.config file.

My scenario is:

Each machine has a machine name, so (I assume this is the best place to put it)
I want to create a variable in <appsettings> in the machine.config file
called "MachineName".  In my web.config file, I want to use the
MachineName variable in the machine.config in the appsettings.

 

Example: (web.config file)

 ...

<appSettings>

<addkey="ServerFileNames"value=\\ISCO1FEGRD\Dotnet_files\OrclIntlLi
st.xml />

Replace the "ISCO1FEGRD" with the variable "MachineName"
from the Machine.config file.

 

Thanks
Post Reply
about | contact