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