Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ProcessModelConfig' is not accessible in this context because it is 'Private'

Reply
Thread Tools

ProcessModelConfig' is not accessible in this context because it is 'Private'

 
 
Jack Wright
Guest
Posts: n/a
 
      01-02-2004
Dear All,
I would like to read the processModel from machine.config.
The following is code I have writte
Dim hConfig As Object =
ConfigurationSettings.GetConfig("system.web/processModel")
But if I try to typecast hConfig with
System.Web.Configuration.ProcessModelConfig I get the following error:
'System.Web.Configuration.ProcessModelConfig' is not accessible in
this context because it is 'Private'.

I would like to access attribute 'responseDeadlockInterval'.

Please help.

TALIA
Many Regards
Sunil
 
Reply With Quote
 
 
 
 
Chris Jackson
Guest
Posts: n/a
 
      01-02-2004
You can just grab the value directly by reading the XML:

System.Xml.XmlDocument myConfig = new XmlDocument();

myConfig.Load(Server.MapPath("web.config"));

System.Xml.XmlNodeList pmNodeList =
myConfig.GetElementsByTagName("processModel");

string responseDeadlockInterval =
pmNodeList[0].Attributes["responseDeadlockInterval"].Value;

....


--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Jack Wright" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> Dear All,
> I would like to read the processModel from machine.config.
> The following is code I have writte
> Dim hConfig As Object =
> ConfigurationSettings.GetConfig("system.web/processModel")
> But if I try to typecast hConfig with
> System.Web.Configuration.ProcessModelConfig I get the following error:
> 'System.Web.Configuration.ProcessModelConfig' is not accessible in
> this context because it is 'Private'.
>
> I would like to access attribute 'responseDeadlockInterval'.
>
> Please help.
>
> TALIA
> Many Regards
> Sunil



 
Reply With Quote
 
 
 
 
Jack Wright
Guest
Posts: n/a
 
      01-05-2004
Hi Chris,
How do I find the path of machine.config? I want to read the
processmodel from machine.config.

Thanks & Regards
Sunil

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message news:<#wgTL$(E-Mail Removed)>...
> You can just grab the value directly by reading the XML:
>
> System.Xml.XmlDocument myConfig = new XmlDocument();
>
> myConfig.Load(Server.MapPath("web.config"));
>
> System.Xml.XmlNodeList pmNodeList =
> myConfig.GetElementsByTagName("processModel");
>
> string responseDeadlockInterval =
> pmNodeList[0].Attributes["responseDeadlockInterval"].Value;
>
> ...
>
>
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows Client
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
>
> "Jack Wright" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) m...
> > Dear All,
> > I would like to read the processModel from machine.config.
> > The following is code I have writte
> > Dim hConfig As Object =
> > ConfigurationSettings.GetConfig("system.web/processModel")
> > But if I try to typecast hConfig with
> > System.Web.Configuration.ProcessModelConfig I get the following error:
> > 'System.Web.Configuration.ProcessModelConfig' is not accessible in
> > this context because it is 'Private'.
> >
> > I would like to access attribute 'responseDeadlockInterval'.
> >
> > Please help.
> >
> > TALIA
> > Many Regards
> > Sunil

 
Reply With Quote
 
Chris Jackson
Guest
Posts: n/a
 
      01-05-2004
C:\<windows directory/>\Microsoft.NET\Framework\<framework
version/>\CONFIG\machine.config

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Jack Wright" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> Hi Chris,
> How do I find the path of machine.config? I want to read the
> processmodel from machine.config.
>
> Thanks & Regards
> Sunil
>
> "Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
> news:<#wgTL$(E-Mail Removed)>...
>> You can just grab the value directly by reading the XML:
>>
>> System.Xml.XmlDocument myConfig = new XmlDocument();
>>
>> myConfig.Load(Server.MapPath("web.config"));
>>
>> System.Xml.XmlNodeList pmNodeList =
>> myConfig.GetElementsByTagName("processModel");
>>
>> string responseDeadlockInterval =
>> pmNodeList[0].Attributes["responseDeadlockInterval"].Value;
>>
>> ...
>>
>>
>> --
>> Chris Jackson
>> Software Engineer
>> Microsoft MVP - Windows Client
>> Windows XP Associate Expert
>> --
>> More people read the newsgroups than read my email.
>> Reply to the newsgroup for a faster response.
>> (Control-G using Outlook Express)
>> --
>>
>> "Jack Wright" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) m...
>> > Dear All,
>> > I would like to read the processModel from machine.config.
>> > The following is code I have writte
>> > Dim hConfig As Object =
>> > ConfigurationSettings.GetConfig("system.web/processModel")
>> > But if I try to typecast hConfig with
>> > System.Web.Configuration.ProcessModelConfig I get the following error:
>> > 'System.Web.Configuration.ProcessModelConfig' is not accessible in
>> > this context because it is 'Private'.
>> >
>> > I would like to access attribute 'responseDeadlockInterval'.
>> >
>> > Please help.
>> >
>> > TALIA
>> > Many Regards
>> > Sunil



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual directory error: "directory does not exist or is not accessible because of security settings" Dave ASP .Net 1 10-24-2005 02:05 AM
ItemTypes' is not accessible in this context because it is 'Privat =?Utf-8?B?UGF0cmljay5PLklnZQ==?= ASP .Net 1 10-05-2004 08:48 AM
Error When using Crystal Reports: 'C' is not accessible in this context because it is 'Private'. Richard ASP .Net 1 07-27-2004 07:03 AM
'ASP.Test_ascx.UserName' is not accessible in this context because it is 'Protected'. Murphy ASP .Net Web Controls 2 04-26-2004 01:00 AM
is not accessible in this context because it is 'Protected' Murphy ASP .Net 6 04-19-2004 11:44 PM



Advertisments