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