473,739 Members | 5,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ProcessModelCon fig' 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 =
ConfigurationSe ttings.GetConfi g("system.web/processModel")
But if I try to typecast hConfig with
System.Web.Conf iguration.Proce ssModelConfig I get the following error:
'System.Web.Con figuration.Proc essModelConfig' is not accessible in
this context because it is 'Private'.

I would like to access attribute 'responseDeadlo ckInterval'.

Please help.

TALIA
Many Regards
Sunil
Nov 18 '05 #1
4 2879
You can just grab the value directly by reading the XML:

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

myConfig.Load(S erver.MapPath(" web.config"));

System.Xml.XmlN odeList pmNodeList =
myConfig.GetEle mentsByTagName( "processModel") ;

string responseDeadloc kInterval =
pmNodeList[0].Attributes["responseDeadlo ckInterval"].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***@volcanom ail.com> wrote in message
news:8f******** *************** **@posting.goog le.com...
Dear All,
I would like to read the processModel from machine.config.
The following is code I have writte
Dim hConfig As Object =
ConfigurationSe ttings.GetConfi g("system.web/processModel")
But if I try to typecast hConfig with
System.Web.Conf iguration.Proce ssModelConfig I get the following error:
'System.Web.Con figuration.Proc essModelConfig' is not accessible in
this context because it is 'Private'.

I would like to access attribute 'responseDeadlo ckInterval'.

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" <chrisjATmvpsDO TorgNOSPAM> wrote in message news:<#w******* *******@TK2MSFT NGP11.phx.gbl>. ..
You can just grab the value directly by reading the XML:

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

myConfig.Load(S erver.MapPath(" web.config"));

System.Xml.XmlN odeList pmNodeList =
myConfig.GetEle mentsByTagName( "processModel") ;

string responseDeadloc kInterval =
pmNodeList[0].Attributes["responseDeadlo ckInterval"].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***@volcanom ail.com> wrote in message
news:8f******** *************** **@posting.goog le.com...
Dear All,
I would like to read the processModel from machine.config.
The following is code I have writte
Dim hConfig As Object =
ConfigurationSe ttings.GetConfi g("system.web/processModel")
But if I try to typecast hConfig with
System.Web.Conf iguration.Proce ssModelConfig I get the following error:
'System.Web.Con figuration.Proc essModelConfig' is not accessible in
this context because it is 'Private'.

I would like to access attribute 'responseDeadlo ckInterval'.

Please help.

TALIA
Many Regards
Sunil

Nov 18 '05 #3
C:\<windows directory/>\Microsoft.NET \Framework\<fra mework
version/>\CONFIG\machin e.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***@volcanom ail.com> wrote in message
news:8f******** *************** **@posting.goog le.com...
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" <chrisjATmvpsDO TorgNOSPAM> wrote in message
news:<#w******* *******@TK2MSFT NGP11.phx.gbl>. ..
You can just grab the value directly by reading the XML:

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

myConfig.Load(S erver.MapPath(" web.config"));

System.Xml.XmlN odeList pmNodeList =
myConfig.GetEle mentsByTagName( "processModel") ;

string responseDeadloc kInterval =
pmNodeList[0].Attributes["responseDeadlo ckInterval"].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***@volcanom ail.com> wrote in message
news:8f******** *************** **@posting.goog le.com...
> Dear All,
> I would like to read the processModel from machine.config.
> The following is code I have writte
> Dim hConfig As Object =
> ConfigurationSe ttings.GetConfi g("system.web/processModel")
> But if I try to typecast hConfig with
> System.Web.Conf iguration.Proce ssModelConfig I get the following error:
> 'System.Web.Con figuration.Proc essModelConfig' is not accessible in
> this context because it is 'Private'.
>
> I would like to access attribute 'responseDeadlo ckInterval'.
>
> 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 GetFrameworkDir ectory()
{
return Path.GetDirecto ryName(typeof(o bject).Assembly .Location);
}
OR
Dim strDir As String = RuntimeEnvironm ent.GetRuntimeD irectory()

2. Load the machine.config in a xmlDocument
Dim myConfig As System.Xml.XmlD ocument = New XmlDocument()
myConfig.Load(s trDir2 + "\CONFIG\machin e.config")
Dim pmNodeList As System.Xml.XmlN odeList =
myConfig.GetEle mentsByTagName( "processMod el")
Dim responseDeadloc kInterval As String =
pmNodeList(0).A ttributes("resp onseDeadlockInt erval").Value
3. Convert "responseDeadlo ckInterval" 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" <chrisjATmvpsDO TorgNOSPAM> wrote in message news:<e6******* *******@tk2msft ngp13.phx.gbl>. ..
C:\<windows directory/>\Microsoft.NET \Framework\<fra mework
version/>\CONFIG\machin e.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***@volcanom ail.com> wrote in message
news:8f******** *************** **@posting.goog le.com...
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" <chrisjATmvpsDO TorgNOSPAM> wrote in message
news:<#w******* *******@TK2MSFT NGP11.phx.gbl>. ..
You can just grab the value directly by reading the XML:

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

myConfig.Load(S erver.MapPath(" web.config"));

System.Xml.XmlN odeList pmNodeList =
myConfig.GetEle mentsByTagName( "processModel") ;

string responseDeadloc kInterval =
pmNodeList[0].Attributes["responseDeadlo ckInterval"].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***@volcanom ail.com> wrote in message
news:8f******** *************** **@posting.goog le.com...
> Dear All,
> I would like to read the processModel from machine.config.
> The following is code I have writte
> Dim hConfig As Object =
> ConfigurationSe ttings.GetConfi g("system.web/processModel")
> But if I try to typecast hConfig with
> System.Web.Conf iguration.Proce ssModelConfig I get the following error:
> 'System.Web.Con figuration.Proc essModelConfig' is not accessible in
> this context because it is 'Private'.
>
> I would like to access attribute 'responseDeadlo ckInterval'.
>
> 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
8674
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 form from the aspx page that contains the user control. The error message received is: Compiler Error Message: BC30390: 'ASP._userdetails_ascx.Company' is not accessible in this context because it is 'Protected'. Thanks
3
1947
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: 'codelib.editcode.Private Sub SaveRecord(sender As Object, e As System.EventArgs)' is not accessible in this context because it is 'Private'. What am I doing wrong? Everything is in one webform.
1
2762
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 service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30389: 'C' is not accessible in this context because it is 'Private'.
3
1295
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: 'cpncms_v1.evtCalendar.Private Sub Calendar1_DayRender(sender As Object, e As System.Web.UI.WebControls.DayRenderEventArgs)' is not accessible in this
0
928
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 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'.
0
1046
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'". I don't understand why, since I've passed it as a parameter to the sub. Thanks in advance for any help. Here's the entire (unfinished) sub: Sub insertADRecords(ByVal strCurrOU As String, ByVal oResult As SearchResultCollection) Dim iIndex1...
3
8727
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 aInfoListX.sqlConn = New SqlClient.SqlConnection(aInfoListX.params.sqlserver) End Sub
10
14848
by: Greg | last post by:
class a { public: int x; private: int y; } class b : public a {
14
4210
by: v4vijayakumar | last post by:
Why we need "virtual private member functions"? Why it is not an (compile time) error?
0
8792
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9479
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9337
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9266
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6754
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6054
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.