web.config
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngconfig' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Brad Kingsley (VIP)
OK. Has anyone dug deeply into all of the b2 configuration options yet?

I've already got a few questions:
1) What is the "sandboxing" and how is it configured?
2) In the process model attributes I'd like to set the ASP.Net to run under
the context of the IUSR account - but I don't know the password of course.
Is there a way to make this work or do I need to reset the password for the
IUSR and update the IIS settings to match?
3) webgarden = false -- does that mean to use multiple CPUs or not? The
comments state that it controls CPU affinity. What is the best use of this
flag in a multi-CPU machine?
4) CPU mask - if setting webgarden to true is the best method, then what are
valid values for the CPU mask?
5) If I want to set caching on by default for the entire server - or for one
entire site - what is the section in web.config (or maching.config) to
enable this?
6) What's up with the trust levels and security policy? Can anyone send more
info on what exactly these mean?
7) Which of these can be over-ridden in the web.config file vs. those that
can only be set in the machine.config file?

Sorry for all the questions - I'm not lazy, just reading through the 3,000
line machine.config file is a bit taxing.

Thanks

bk

---------------------------------------
The Best Support On The 'Net
Windows 2000 Advanced Hosting
http://www.orcsweb.com/
---------------------------------------

ASP.Net FAQ - http://www.aspnetfaq.com/
ASPAlliance - http://www.aspalliance.com/
SQL Index - http://www.sqlindex.com

Reply to this message...
 
    
Tim Heuer (VIP)
-- This message, which was originally sent to "aspngcs", has been moved to "aspngconfig" mailing list by the List Master --

Is there a mechanism for accessing ConfigurationSettings in a non-ASP.NET
application?

I am wanting to host a configuration file with settings such as database
connections, etc. and access them from an application using a similar method
that you would use in ASP.NET
(Configuration.ConfigurationSettings.AppSettings["mysetting"]).

Tim

__________________________
Tim Heuer
Integrated Information Systems
(480) 317-8724
Click here to reveal e-mail address

(NASDAQ: IISX)

Reply to this message...
 
    
Mel C Solomon

Hello all,

Could someone tell me how to properly place the below code in web.config file:

string strconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(".//db//db1.mdb");

into(w/c not correct):

<configuration>
<appSettings>
<add key="d" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\db\db1.mdb" />
</appSettings>
</configuration>

Regards,
mel :-)

__________________________________
www.edsamail.com

Reply to this message...
 
    
Rob Howard (VIP)
Here's a bit of help:

2. Set <identity impersonate=3D"true"/>
3 & 4. The webgarden and cpuMask settings go hand-in-hand. Webgarden
mode allows ASP.NET to create a worker process for each processor on the
server. The cpuMask controls which processors can be used, i.e. if you
have a 4 proc box you could run ASP.NET only on processors 1 & 2.
5. There isn't one, you have to explicitly add it to each page

-----Original Message-----
From: Brad Kingsley [mailto:Click here to reveal e-mail address]=20
Sent: Wednesday, June 20, 2001 10:39 AM
To: aspngconfig
Subject: [aspngconfig] web.config

OK. Has anyone dug deeply into all of the b2 configuration options yet?

I've already got a few questions:
1) What is the "sandboxing" and how is it configured?
2) In the process model attributes I'd like to set the ASP.Net to run
under the context of the IUSR account - but I don't know the password of
course. Is there a way to make this work or do I need to reset the
password for the IUSR and update the IIS settings to match?
3) webgarden =3D false -- does that mean to use multiple CPUs or not? =
The
comments state that it controls CPU affinity. What is the best use of
this flag in a multi-CPU machine?
4) CPU mask - if setting webgarden to true is the best method, then what
are valid values for the CPU mask?
5) If I want to set caching on by default for the entire server - or for
one entire site - what is the section in web.config (or maching.config)
to enable this?
6) What's up with the trust levels and security policy? Can anyone send
more info on what exactly these mean?
7) Which of these can be over-ridden in the web.config file vs. those
that can only be set in the machine.config file?

Sorry for all the questions - I'm not lazy, just reading through the
3,000 line machine.config file is a bit taxing.

Thanks

bk

---------------------------------------
The Best Support On The 'Net
Windows 2000 Advanced Hosting
http://www.orcsweb.com/
---------------------------------------

ASP.Net FAQ - http://www.aspnetfaq.com/
ASPAlliance - http://www.aspalliance.com/
SQL Index - http://www.sqlindex.com

| [aspngconfig] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngconfig.asp =3D JOIN/QUIT=20
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Doug Seven

Brad,

Here's a couple answers...more to come soon:

3) webgarden = false -- does that mean to use multiple CPUs or not? The
comments state that it controls CPU affinity. What is the best use of this
flag in a multi-CPU machine?

False means that Windows will manage CPU affinity. True means that the
cpuMask attribute will be used to manage CPU affinity.
webGarden and cpuMask are machine wide settings and can only be set in the
machine.config file, and not att the application level.

4) CPU mask - if setting webgarden to true is the best method, then what are
valid values for the CPU mask?

DWORD value for a bit mask. Default value is 0xffffffff which equates to:
11111111111111111111111111111111

Each bit represents a CPU, reading right to left. The first CPU (cpu 0) is
the right-most position. In an eight processor box, you can set CPU's 0 and
2-7 to run ASP.NET processes, while CPU 1 does not.

11111101 = 0x0000007b

___________________________________________
Doug Seven
dotnetjunkies.com

Are you a DotNetJunkie?
http://www.DotNetJunkies.com

Still not enough? Buy the book:
Programming Datadriven Web Applications with ASP.NET
by Doug Seven and Don Mack
http://www.amazon.com/exec/obidos/ASIN/0672321068/dotnetjunkies-20/

"Honestly, this really isn't a brains kind of operation"
- Benicio del Toro, The Way of the Gun

Reply to this message...
 
    
Brad Kingsley (VIP)
Thanks Rob.

[Original message clipped]

So, on a two-proc (or more) server, should we enable webgarden or let
ASP.Net handle it automatically?

bk

---------------------------------------
The Best Support On The 'Net
Windows 2000 Advanced Hosting
http://www.orcsweb.com/
---------------------------------------

ASP.Net FAQ - http://www.aspnetfaq.com/
ASPAlliance - http://www.aspalliance.com/
SQL Index - http://www.sqlindex.com

.
----- Original Message -----
From: "Rob Howard" <Click here to reveal e-mail address>
To: "aspngconfig" <Click here to reveal e-mail address>
Sent: Wednesday, June 20, 2001 3:08 PM
Subject: [aspngconfig] RE: web.config

Here's a bit of help:

2. Set <identity impersonate="true"/>
3 & 4. The webgarden and cpuMask settings go hand-in-hand. Webgarden
mode allows ASP.NET to create a worker process for each processor on the
server. The cpuMask controls which processors can be used, i.e. if you
have a 4 proc box you could run ASP.NET only on processors 1 & 2.
5. There isn't one, you have to explicitly add it to each page

-----Original Message-----
From: Brad Kingsley [mailto:Click here to reveal e-mail address]
Sent: Wednesday, June 20, 2001 10:39 AM
To: aspngconfig
Subject: [aspngconfig] web.config

OK. Has anyone dug deeply into all of the b2 configuration options yet?

I've already got a few questions:
1) What is the "sandboxing" and how is it configured?
2) In the process model attributes I'd like to set the ASP.Net to run
under the context of the IUSR account - but I don't know the password of
course. Is there a way to make this work or do I need to reset the
password for the IUSR and update the IIS settings to match?
3) webgarden = false -- does that mean to use multiple CPUs or not? The
comments state that it controls CPU affinity. What is the best use of
this flag in a multi-CPU machine?
4) CPU mask - if setting webgarden to true is the best method, then what
are valid values for the CPU mask?
5) If I want to set caching on by default for the entire server - or for
one entire site - what is the section in web.config (or maching.config)
to enable this?
6) What's up with the trust levels and security policy? Can anyone send
more info on what exactly these mean?
7) Which of these can be over-ridden in the web.config file vs. those
that can only be set in the machine.config file?

Sorry for all the questions - I'm not lazy, just reading through the
3,000 line machine.config file is a bit taxing.

Thanks

bk

---------------------------------------
The Best Support On The 'Net
Windows 2000 Advanced Hosting
http://www.orcsweb.com/
---------------------------------------

ASP.Net FAQ - http://www.aspnetfaq.com/
ASPAlliance - http://www.aspalliance.com/
SQL Index - http://www.sqlindex.com

| [aspngconfig] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngconfig.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngconfig] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngconfig.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Brad Kingsley (VIP)
Thanks Doug. Any thoughts on the other questions? Have you guys played with
them yet?

bk

.
----- Original Message -----
From: "Doug Seven" <Click here to reveal e-mail address>
To: "aspngconfig" <Click here to reveal e-mail address>
Sent: Wednesday, June 20, 2001 1:51 PM
Subject: [aspngconfig] RE: web.config

[Original message clipped]

Reply to this message...
 
    
Doug Seven

In a few days I will be posting a "Coping with a New Beta" tutorial on
DotNetJunkies.com about the configuration files. I don't have all your
answers yet, but I am working on it. Sorry :(
___________________________________________
Doug Seven
dotnetjunkies.com

Are you a DotNetJunkie?
http://www.DotNetJunkies.com

Still not enough? Buy the book:
Programming Datadriven Web Applications with ASP.NET
by Doug Seven and Don Mack
http://www.amazon.com/exec/obidos/ASIN/0672321068/dotnetjunkies-20/

"Honestly, this really isn't a brains kind of operation"
- Benicio del Toro, The Way of the Gun

-----Original Message-----
From: Brad Kingsley [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 21, 2001 6:33 PM
To: aspngconfig
Subject: [aspngconfig] RE: web.config

Thanks Doug. Any thoughts on the other questions? Have you guys played with
them yet?

bk

.
----- Original Message -----
From: "Doug Seven" <Click here to reveal e-mail address>
To: "aspngconfig" <Click here to reveal e-mail address>
Sent: Wednesday, June 20, 2001 1:51 PM
Subject: [aspngconfig] RE: web.config

[Original message clipped]

| [aspngconfig] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngconfig.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
SHEATHER,Kristoffer
How are more than 8 processors handled?

-----Original Message-----
From: Doug Seven [mailto:Click here to reveal e-mail address]
Sent: Friday, 22 June 2001 13:45
To: aspngconfig
Subject: [aspngconfig] RE: web.config

In a few days I will be posting a "Coping with a New Beta" tutorial on
DotNetJunkies.com about the configuration files. I don't have all your
answers yet, but I am working on it. Sorry :(
___________________________________________
Doug Seven
dotnetjunkies.com

Are you a DotNetJunkie?
http://www.DotNetJunkies.com

Still not enough? Buy the book:
Programming Datadriven Web Applications with ASP.NET
by Doug Seven and Don Mack
http://www.amazon.com/exec/obidos/ASIN/0672321068/dotnetjunkies-20/

"Honestly, this really isn't a brains kind of operation"
- Benicio del Toro, The Way of the Gun

-----Original Message-----
From: Brad Kingsley [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 21, 2001 6:33 PM
To: aspngconfig
Subject: [aspngconfig] RE: web.config

Thanks Doug. Any thoughts on the other questions? Have you guys played with
them yet?

bk

.
----- Original Message -----
From: "Doug Seven" <Click here to reveal e-mail address>
To: "aspngconfig" <Click here to reveal e-mail address>
Sent: Wednesday, June 20, 2001 1:51 PM
Subject: [aspngconfig] RE: web.config

[Original message clipped]

| [aspngconfig] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngconfig.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngconfig] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngconfig.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Notice:
The information contained in this e-mail message and any attached files may
be confidential information, and may also be the subject of legal
professional privilege. If you are not the intended recipient any use,
disclosure or copying of this e-mail is unauthorised. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete all copies of this transmission together with any attachments.

Reply to this message...
 
    
Bob Levittan (VIP)
web.config is an XML file, so you could use whatever XML method you can
find.
.........................................

-- This message, which was originally sent to "aspngcs", has been moved to
"aspngconfig" mailing list by the List Master --

Is there a mechanism for accessing ConfigurationSettings in a non-ASP.NET
application?

I am wanting to host a configuration file with settings such as database
connections, etc. and access them from an application using a similar method
that you would use in ASP.NET
(Configuration.ConfigurationSettings.AppSettings["mysetting"]).

Tim

__________________________
Tim Heuer
Integrated Information Systems
(480) 317-8724
Click here to reveal e-mail address

(NASDAQ: IISX)

| [aspngconfig] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngconfig.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply to this message...
 
    
Henry Hoffmann
Yes, there is.

I don't remember the exact details but there definitly is a mechanism using
files that look a lot like config.web.

I quote from MSDN:

"
EXE-Hosted Applications
A configuration file of an application hosted by the EXE is in the same
directory as the application. The name of the configuration file is the name
of the application with a .config extension. For example, an application
called myApp.exe can be associated with a configuration file called
myApp.exe.config.

ASP.NET-Hosted Applications
ASP.NET configuration files are called Web.config. Configuration files in
ASP.NET applications inherit the settings of configuration files in the URL
path. For example, given the URL www.microsoft.com/aaa/bbb where
www.microsoft.com/aaa is the Web application, the configuration file that is
associated with the application is located at www.microsoft.com/aaa. ASP.NET
pages that are in the subdirectory /bbb will use both the settings that are
in the configuration file at the application level and the settings in the
configuration file that is in /bbb.
"

If you want more info, I suggest you search MSDN on "Configuration"

I hope this helps

Henry

-----Original Message-----
From: Tim Heuer [mailto:Click here to reveal e-mail address]
Sent: Thursday, 12 July, 2001 19:07
To: aspngconfig
Subject: [aspngconfig] Web.config

-- This message, which was originally sent to "aspngcs", has been moved to
"aspngconfig" mailing list by the List Master --

Is there a mechanism for accessing ConfigurationSettings in a non-ASP.NET
application?

I am wanting to host a configuration file with settings such as database
connections, etc. and access them from an application using a similar method
that you would use in ASP.NET
(Configuration.ConfigurationSettings.AppSettings["mysetting"]).

Tim

__________________________
Tim Heuer
Integrated Information Systems
(480) 317-8724
Click here to reveal e-mail address

(NASDAQ: IISX)

| [aspngconfig] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngconfig.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Juan T. Llibre
From the documentation :

EXE-Hosted Applications
A configuration file of an application hosted by the EXE is in the same
directory as the application. The name of the configuration file is the name
of the application with a .config extension. For example, an application
called myApp.exe can be associated with a configuration file called
myApp.exe.config.

Internet Explorer-Hosted Applications
If an application hosted in Internet Explorer has a configuration file, the
location of the configuration file is specified in a <link> tag with the
following syntax:

<link rel="Configuration" href="[location]">

In this tag, [location] is a URL to the configuration file.

best,

--
Juan T. Llibre
Microsoft MVP [IIS/ASP]
"Beginning ASP.NET", Wrox Press - Look for it in August!
========================================

"Bob Levittan" <Click here to reveal e-mail address> wrote in message
news:428820@aspngconfig...
[Original message clipped]

Reply to this message...
 
    
caotiejun
I connected to SQL Server

<configuration>
<appSettings>
<add key="ConnectionString" value="Initial Catalog=weiqi;Data
Source=localhost;uid=sa;pwd=;" />
</appSettings>
</configuration>

Dim myConnection as SQLConnection = new
SQLConnection(ConfigurationSettings.AppSettings("ConnectionString"))
----- Original Message -----
From: "Mel C Solomon" <Click here to reveal e-mail address>
To: "aspngconfig" <Click here to reveal e-mail address>
Sent: Sunday, August 12, 2001 11:48 AM
Subject: [aspngconfig] web.config

[Original message clipped]

Reply to this message...
 
    
Dennis West (VIP)
<!-- application specific settings -->
<appSettings>
<add key="ConnectionString"
value="server=222.222.222.22;uid=myusernamme;pwd=mypswd;database=mydbname"
/>
</appSettings>

----- Original Message -----
From: "Mel C Solomon" <Click here to reveal e-mail address>
To: "aspngconfig" <Click here to reveal e-mail address>
Sent: Saturday, August 11, 2001 8:48 PM
Subject: [aspngconfig] web.config

[Original message clipped]

Reply to this message...
 
    
Michel Comeau
Hi Mel,

There is no way that i know of to have the Server.MapPath() function being
part of the connect string.

I know what you are trying to do and i wish i could do the same myself. The
only way i found was to store database path separately

<configuration>
<appSettings>
<add key="dbwebpath" value"/databases/mydatabase.db" />
</appSettings>
</configuration>

then i initialize my connection string to:

string strconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
Server.MapPath(ConfigurationSettings.AppSettings("dbwebpath"));

Regards,
Michel C.

-----Original Message-----
From: Mel C Solomon [mailto:Click here to reveal e-mail address]
Sent: Saturday, August 11, 2001 11:49 PM
To: aspngconfig
Subject: [aspngconfig] web.config

Hello all,

Could someone tell me how to properly place the below code in web.config
file:

string strconn="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="+Server.MapPath(".//db//db1.mdb");

into(w/c not correct):

<configuration>
<appSettings>
<add key="d" value="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\db\db1.mdb" />
</appSettings>
</configuration>

Regards,
mel :-)

__________________________________
www.edsamail.com

| [aspngconfig] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngconfig.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Lucy W
-- Moved from [aspngfreeforall] to [aspngconfig] by James Avery <Click here to reveal e-mail address> --

Hi all,

I got a quick question here and I know it is a no
brainer but I couldn't somehow get it...

I have different image directories that store images
for different purpose. I'd like to define some global
application variables that point to each of them so
that when I use them I don't need to specify the path.
For example, AppImages=/webroot/app/images/ and
headerImages=/webroot/app/header/images/.

Do I create them in web.config? How do I reference
them in my .aspx pages? Could anyone give me some
pointers?

Thanks.
Lucy

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

Reply to this message...
 
    
JPadams@aol.com
You could preconfigure the paths in web.config:

<appSettings>
<add key="AppImages" value="=/webroot/app/images/" />
</appSettings>

Then you would access them with something like :

(C#) string AppImagePath = ConfigurationSettings.AppSettings[AppImages]

Regards,
J.P. Adams

-------------------------------------------------------------------------
I have different image directories that store images
for different purpose. I'd like to define some global
application variables that point to each of them so
that when I use them I don't need to specify the path.
For example, AppImages=/webroot/app/images/ and
headerImages=/webroot/app/header/images/.

Do I create them in web.config? How do I reference
them in my .aspx pages? Could anyone give me some
pointers?
------------------------------------------------------------------------------

---
Reply to this message...
 
    
dave wanta (VIP)
hi all,
Does anyone have any links, or examples, of programmatically accessing the web.config to modify it?

Thanks,
Dave
Reply to this message...
 
    
Development
-- Moved from [aspngfreeforall] to [aspngconfig] by Marcie Jones <Click here to reveal e-mail address> --

Hello All,

I am having a problem with setting up the SQLServerState in the =
web.config file. I have used these settings before, then my machine had =
a meltdown. I reinstalled everything and now I am trying to get things =
running again.

I have already used the InstallSQLState.sql file and created the =
tables needed and I have stopped and re-started the SQL service. I have =
even re-booted the machine. Below is the string (minus sensitive info) =
that I am using in the web.config.

<sessionState mode=3D"SQLServer" sqlConnectionString=3D"data =
source=3DSERVER_NAME;user id=3DUSER_ID;password=3DPASSWORD" =
cookieless=3D"false" timeout=3D"20" />

The connection string is valid, but when I run the page, I get the =
following error:

Configuration Error=20
Description: An error occurred during the processing of a configuration =
file required to service this request. Please review the specific error =
details below and modify your configuration file appropriately.=20

Parser Error Message: It is an error to use a section registered as =
allowDefinition=3D'MachineToApplication' beyond application level. This =
error can be caused by a virtual directory not being configured as an =
application in IIS.

Source Error:=20

Line 53: --> Line 54: <globalization =
requestEncoding=3D"utf-8" responseEncoding=3D"utf-8" /> Line 55: =
<sessionState mode=3D"SQLServer" sqlConnectionString=3D"data =
source=3DSERVER_NAME;user id=3DUSER_ID;password=3DPASSWORD" =
cookieless=3D"false" timeout=3D"20" /> Line 56: <authentication =
mode=3D"Windows" /> Line 57: </system.web>=09

Source File: C:\NewSite\NewSite\testing\Rebuild\web.config Line: 55=20

Any ideas about what the error could be would be greatly appreciated.

Thank you,

John

Reply to this message...
 
    
Brad Kingsley
Sounds like that feature is blocked at the machine.config level on that
server.

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Powerful Web Hosting Solutions
#1 in Service and Support

----- Original Message -----
From: "Development" <Click here to reveal e-mail address>
To: "aspngconfig" <Click here to reveal e-mail address>
Sent: Tuesday, July 02, 2002 3:40 AM
Subject: [aspngconfig] Web.Config

> -- Moved from [aspngfreeforall] to [aspngconfig] by Marcie Jones
<Click here to reveal e-mail address> --
[Original message clipped]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
 
System.Configuration.ConfigurationSettings




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com