By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 938 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Configuration problem ( very urgent )

P: n/a
I'm developing a web application i.e. asp.net. I have added a key named
"Provider" in web.config file as follows

<appSettings>
<add key="Provider" value="3"></add>
<add key="OracleClient" value="data source=global;user
id=atms_user;password=sql"></add>
<add key="Connection" value="server=global;user
Id=atms_user;password=sql"></add>
</appSettings>

And while coding when I wanted to retrive the provider as below
string provider = ConfigurationSettings.AppSettings["Provider"];

the application is giving the following error
Error loading XML file
c:\winnt\microsoft.net\framework\v1.0.3705\Config\ machine.config Request for
the permission of type
System.Security.Permissions.StrongNameIdentityPerm ission, mscorlib,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
(c:\winnt\microsoft.net\framework\v1.0.3705\Config \machine.config)
It seems that application instead of getting the key from web.config i think
it is trying to get from machine.config

Please respond me as soon as possible

thanks in advance

Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Just to prevent opening is already opened bellow. No problem at all.
Nov 22 '05 #2

P: n/a
"Sai Pavan" <Sa******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
I'm developing a web application i.e. asp.net. I have added a key named
"Provider" in web.config file as follows

<appSettings>
<add key="Provider" value="3"></add>
<add key="OracleClient" value="data source=global;user
id=atms_user;password=sql"></add>
<add key="Connection" value="server=global;user
Id=atms_user;password=sql"></add>
</appSettings>

And while coding when I wanted to retrive the provider as below
string provider = ConfigurationSettings.AppSettings["Provider"];

the application is giving the following error
Error loading XML file
c:\winnt\microsoft.net\framework\v1.0.3705\Config\ machine.config Request
for
the permission of type
System.Security.Permissions.StrongNameIdentityPerm ission, mscorlib,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
(c:\winnt\microsoft.net\framework\v1.0.3705\Config \machine.config)
It seems that application instead of getting the key from web.config i
think
it is trying to get from machine.config

It will always read machine.config first (to get the default values for
<appSettings> for every app on the machine) and then it will read web.config
afterwards overwriting the defaults from machine.config if necessary. This
is the way that its designed to work.

The question is why you get the error loading machine.config. Do you have
any custom Code Access Security permissions?

Richard
--
www.richardgrimes.com
my email ev******@zicf.bet is encrypted with ROT13 (www.rot13.org)
Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.