473,387 Members | 1,520 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,387 software developers and data experts.

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

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
Nov 18 '05 #1
4 2862
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" <su***@volcanomail.com> wrote in message
news:8f*************************@posting.google.co 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

Nov 18 '05 #2
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:<#w**************@TK2MSFTNGP11.phx.gbl>...
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" <su***@volcanomail.com> wrote in message
news:8f*************************@posting.google.co 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

Nov 18 '05 #3
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" <su***@volcanomail.com> wrote in message
news:8f*************************@posting.google.co 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:<#w**************@TK2MSFTNGP11.phx.gbl>...
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" <su***@volcanomail.com> wrote in message
news:8f*************************@posting.google.co 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

Nov 18 '05 #4
Dear All,
The following is the workflow I implemented...
1. Declare a function in
//works on multiple runtimes (i.e. Mono and Rotor)
public static string GetFrameworkDirectory()
{
return Path.GetDirectoryName(typeof(object).Assembly.Loca tion);
}
OR
Dim strDir As String = RuntimeEnvironment.GetRuntimeDirectory()

2. Load the machine.config in a xmlDocument
Dim myConfig As System.Xml.XmlDocument = New XmlDocument()
myConfig.Load(strDir2 + "\CONFIG\machine.config")
Dim pmNodeList As System.Xml.XmlNodeList =
myConfig.GetElementsByTagName("processModel")
Dim responseDeadlockInterval As String =
pmNodeList(0).Attributes("responseDeadlockInterval ").Value
3. Convert "responseDeadlockInterval" to the interval u want i.e.
mintues or seconds.

I guess this is a right method to do it programatically...

Many Regards
Sunil

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message news:<e6**************@tk2msftngp13.phx.gbl>...
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" <su***@volcanomail.com> wrote in message
news:8f*************************@posting.google.co 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:<#w**************@TK2MSFTNGP11.phx.gbl>...
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" <su***@volcanomail.com> wrote in message
news:8f*************************@posting.google.co 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

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Murphy | last post by:
I've read through the google posts on this topic and am still unclear of the solution. Simply I have a user control that contains form controls and I would like to reference the values in the...
3
by: Tim Zych | last post by:
If I declare a procedure in a webform as Public and attach it to a button in the same webform, it runs fine. If I change it to Private Sub and try to click it i get the error: ...
1
by: Richard | last post by:
I keep getting this error and i dont know how 2 fix it. If someone knows how, please tell me :D Compilation Error Description: An error occurred during the compilation of a resource required to...
3
by: Tim::.. | last post by:
Can someone please tell me why I'm getting the following error! I have absolutely no idea why this error keeps appearing! Thanks for any help! Compiler Error Message: BC30390:...
0
by: Sunil Menon | last post by:
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...
0
by: Bmack500 | last post by:
I'm getting an error when I try to access the properties in oResult, stating: "System.DirectoryServices.SearchResultCollection.Properties is not accessible in this context because it is 'private'"....
3
by: Bmack500 | last post by:
I have a sub, and a class. The sub is like this: Sub dothis() Dim aInfoListX As New infoWrapperClass aInfoListX.params = ReadConfig() Dim sqlCMD As New SqlCommand aInfoListX.sqlCmd = sqlCMD ...
10
by: Greg | last post by:
class a { public: int x; private: int y; } class b : public a {
14
by: v4vijayakumar | last post by:
Why we need "virtual private member functions"? Why it is not an (compile time) error?
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.