Home All Groups Group Topic Archive Search About

'Global\.net clr networking' is denied - via IPAddress.TryParse

Author
9 Dec 2008 5:21 PM
AltairVI
Hello.

I am seeing the following exception
   Access to the path 'Global\.net clr networking' is denied when trying to
use the IPAddress.TryParse method.
It looks like the .NET Sockets is trying to use a performance counter when
InitializeSockets gets called (via IPAddress.TryParse).

I am running Vista Windows Vista Business SP1 on a stand alone machine.
I have installed the .NET 3.5 framework and VS 2008 (not the SP1 versions).

I enabled the "Guest" account.  I am logged into the machine as "Guest" when
running my application.  The admin and other standard user accounts work
fine; it is just something with the Guest account.

The application I have written is a simple WPF Application that contains a
single textbox in a grid.
In the Window's constructor I have added code to parse a string as an IP
address.  I call IPAddress.TryParse and
catch the error.  The exception details are below.

Furthermore if I launch the application again, while the first one is
running; the second instance of the application works perfectly.  This is not
a single instance application.


public partial class Window1 : Window
{
    public Window1()
    {
        InitializeComponent();

        IPAddress ip;
        string ipAddress = "192.168.10.10";
        try
       {
            if(IPAddress.TryParse(sIPAddress, out ip))
         {
            textBox1.Text += "Success - "+ip.ToString();
         }


      }   
      catch (Exception ex)
      {
            /* Print out the exception information
                Please see output below
             */
       }
    }
}



ex.Message = "Exception has been thrown by the target of an invocation."
ex.Source = "mscorelib"

ex.InnerException = {"Access to the path 'Global\\.net clr networking' is
denied."}
ex.InnerException.StackTrace "   at System.IO.__Error.WinIOError(Int32
errorCode, String maybeFullPath)
  at System.Threading.Mutex.<>c__DisplayClass3.<.ctor>b__0(Object userData)
  at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
  at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name,
Boolean& createdNew, MutexSecurity mutexSecurity)\r\n   at
System.Diagnostics.SharedUtils.EnterMutexWithoutGlobal(String mutexName,
Mutex& mutex)
  at System.Diagnostics.SharedPerformanceCounter.Verify(CategoryEntry*
currentCategoryPointer)
  at
System.Diagnostics.SharedPerformanceCounter.FindCategory(CategoryEntry**
returnCategoryPointerReference)
  at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
counterName, String instanceName, Boolean enableReuse,
PerformanceCounterInstanceLifetime lifetime)
  at System.Diagnostics.SharedPerformanceCounter..ctor(String catName,
String counterName, String instanceName, PerformanceCounterInstanceLifetime
lifetime)
  at System.Diagnostics.PerformanceCounter.Initialize()
  at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)  
  at System.Net.NetworkingPerfCounters.Initialize()
  at System.Net.Configuration.SettingsSectionInternal..ctor(SettingsSection
section)
  at System.Net.Configuration.SettingsSectionInternal.get_Section()
  at System.Net.Sockets.Socket.InitializeSockets()
  at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
  at System.Net.IPAddress.TryParse(String ipString, IPAddress& address)
:
:

Thanks for any help anyone can offer.

Author
27 Feb 2009 9:42 AM
Wei
I have the same issue here. Anyone has any ideas?

Show quoteHide quote
"AltairVI" wrote:

> Hello.
>
> I am seeing the following exception
>    Access to the path 'Global\.net clr networking' is denied when trying to
> use the IPAddress.TryParse method.
> It looks like the .NET Sockets is trying to use a performance counter when
> InitializeSockets gets called (via IPAddress.TryParse).
>
> I am running Vista Windows Vista Business SP1 on a stand alone machine.
> I have installed the .NET 3.5 framework and VS 2008 (not the SP1 versions).
>
> I enabled the "Guest" account.  I am logged into the machine as "Guest" when
> running my application.  The admin and other standard user accounts work
> fine; it is just something with the Guest account.
>
> The application I have written is a simple WPF Application that contains a
> single textbox in a grid.
> In the Window's constructor I have added code to parse a string as an IP
> address.  I call IPAddress.TryParse and
> catch the error.  The exception details are below.
>
> Furthermore if I launch the application again, while the first one is
> running; the second instance of the application works perfectly.  This is not
> a single instance application.
>
>
> public partial class Window1 : Window
> {
>     public Window1()
>     {
>         InitializeComponent();
>
>         IPAddress ip;
>         string ipAddress = "192.168.10.10";
>         try
>        {
>             if(IPAddress.TryParse(sIPAddress, out ip))
>          {
>             textBox1.Text += "Success - "+ip.ToString();
>          }
>
>
>       }   
>       catch (Exception ex)
>       {
>             /* Print out the exception information
>                 Please see output below
>              */
>        }
>     }
> }
>
>
>
> ex.Message = "Exception has been thrown by the target of an invocation."
> ex.Source = "mscorelib"
>
> ex.InnerException = {"Access to the path 'Global\\.net clr networking' is
> denied."}
> ex.InnerException.StackTrace "   at System.IO.__Error.WinIOError(Int32
> errorCode, String maybeFullPath)
>   at System.Threading.Mutex.<>c__DisplayClass3.<.ctor>b__0(Object userData)
>   at
> System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
>   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name,
> Boolean& createdNew, MutexSecurity mutexSecurity)\r\n   at
> System.Diagnostics.SharedUtils.EnterMutexWithoutGlobal(String mutexName,
> Mutex& mutex)
>   at System.Diagnostics.SharedPerformanceCounter.Verify(CategoryEntry*
> currentCategoryPointer)
>   at
> System.Diagnostics.SharedPerformanceCounter.FindCategory(CategoryEntry**
> returnCategoryPointerReference)
>   at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
> counterName, String instanceName, Boolean enableReuse,
> PerformanceCounterInstanceLifetime lifetime)
>   at System.Diagnostics.SharedPerformanceCounter..ctor(String catName,
> String counterName, String instanceName, PerformanceCounterInstanceLifetime
> lifetime)
>   at System.Diagnostics.PerformanceCounter.Initialize()
>   at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)  
>   at System.Net.NetworkingPerfCounters.Initialize()
>   at System.Net.Configuration.SettingsSectionInternal..ctor(SettingsSection
> section)
>   at System.Net.Configuration.SettingsSectionInternal.get_Section()
>   at System.Net.Sockets.Socket.InitializeSockets()
>   at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
>   at System.Net.IPAddress.TryParse(String ipString, IPAddress& address)
> :
> :
>
> Thanks for any help anyone can offer.
>
Author
12 Mar 2009 12:21 PM
kulwindertamber
Do anyone has solution to this post?

Its urgent
Thanks in advance