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

Discussion in 'ASP .Net' started by Jack Wright, Jan 2, 2004.

  1. Jack Wright

    Jack Wright Guest

    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
    Jack Wright, Jan 2, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    Chris Jackson, Jan 2, 2004
    #2
    1. Advertising

  3. Jack Wright

    Jack Wright Guest

    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$>...
    > 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" <> wrote in message
    > news:...
    > > 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
    Jack Wright, Jan 5, 2004
    #3
  4. 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" <> wrote in message
    news:...
    > 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$>...
    >> 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" <> wrote in message
    >> news:...
    >> > 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
    Chris Jackson, Jan 5, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Murphy
    Replies:
    6
    Views:
    4,772
    Murphy
    Apr 20, 2004
  2. Richard
    Replies:
    1
    Views:
    1,792
    Steven Cheng[MSFT]
    Jul 27, 2004
  3. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    ItemTypes' is not accessible in this context because it is 'Privat

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,987
    Martin Dechev
    Oct 5, 2004
  4. Dave
    Replies:
    1
    Views:
    9,740
    Steven Cheng[MSFT]
    Oct 24, 2005
  5. Murphy
    Replies:
    2
    Views:
    251
    Murphy
    Apr 26, 2004
Loading...

Share This Page