473,320 Members | 2,000 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,320 software developers and data experts.

Configuration problem ( very urgent )

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
2 1204
Just to prevent opening is already opened bellow. No problem at all.
Nov 22 '05 #2
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Alessandro | last post by:
When I build a setup project under vb2005, starts "Microsoft sql server 2005 Tool" showing "Please wait while windows configures Microsoft sql server 2005 tools" Then it stop with this message:...
7
by: Steven Cliff | last post by:
I have started to use the new Enterprise Library (Jan 06) and have set up a skeleton project using the DAAB. This all seems to work fine apart from when I come to secure the app.config file via...
5
by: Hardy Wang | last post by:
Hi all, I understand, in .Net 2.0 we have little bit different model to read config file from .Net 1.1. Basically I need to use WebConfigurationManager.AppSettings to read from web.config, and...
6
by: Jeff Hegedus | last post by:
I have a dll that requires some configuration data. I put the configuration data in a custom configuration section in a config file that is loaded in the installation folder of the dll. If I...
3
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am trying to implement a configuration section in web.config and was wondering if I could do it without writing a handeler. I tried in the <configSections>. <sectionGroup name="Domains" >...
5
by: Allan Ebdrup | last post by:
I have a webservice in ASP.Net 2.0, I need to store and load a xml configuration file in relation to one of the web methods in my webservice. What's the best place to store and the best way to load...
1
by: =?Utf-8?B?RGljaw==?= | last post by:
My Windows Application stores its configuration values in app.config and these are typed and accessed via corresponding classes, something like this... <configSections> <section name="Watcher"/>...
7
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in...
3
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.