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

J

Jack Wright

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
 
C

Chris Jackson

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;

....
 
J

Jack Wright

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 said:
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 said:
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
 
C

Chris Jackson

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 said:
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 said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top