Go Back   Velocity Reviews > Newsgroups > Microsoft Certification
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Microsoft Certification - question about webconfigurationmanager.appsettings

 
Thread Tools Search this Thread
Old 10-23-2006, 10:05 PM   #1
Default question about webconfigurationmanager.appsettings


This works in a C#ASP.NET Website application:
string strSQL = WebConfigurationManager.AppSettings["ConnString"].ToString();

However if I try using this statement in a c#dll class library, I get the
error:
'Object Reference not set to an instance of an object'

I've looked on the internet, and whilst a number of people have registered
this problem, no-one has yet provided a solution. Can you provide one please?

Regard,

Ahmad


=?Utf-8?B?QWhtYWQ=?=
  Reply With Quote
Old 10-23-2006, 10:55 PM   #2
=?Utf-8?B?QWhtYWQ=?=
 
Posts: n/a
Default RE: question about webconfigurationmanager.appsettings

Is it possible that C#DLL security settings are tighter than C#ASP.NET ones,
in the sense that the DLL(in its natural state) doesn't have permission to
read a web.config file, whereas a C#ASP.NET file does?



"Ahmad" wrote:

> This works in a C#ASP.NET Website application:
> string strSQL = WebConfigurationManager.AppSettings["ConnString"].ToString();
>
> However if I try using this statement in a c#dll class library, I get the
> error:
> 'Object Reference not set to an instance of an object'
>
> I've looked on the internet, and whilst a number of people have registered
> this problem, no-one has yet provided a solution. Can you provide one please?
>
> Regard,
>
> Ahmad

  Reply With Quote
Old 10-24-2006, 04:10 AM   #3
Jonathan Roberts
 
Posts: n/a
Default Re: question about webconfigurationmanager.appsettings


"Ahmad" <> wrote in message
news:7EC71689-050F-48B3-82FE-...
> This works in a C#ASP.NET Website application:
> string strSQL =

WebConfigurationManager.AppSettings["ConnString"].ToString();
>
> However if I try using this statement in a c#dll class library, I get the
> error:
> 'Object Reference not set to an instance of an object'
>
> I've looked on the internet, and whilst a number of people have registered
> this problem, no-one has yet provided a solution. Can you provide one

please?
>
> Regard,
>
> Ahmad


Wrong newsgroup


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump