Groups | Blog | Home
all groups > dotnet clr > march 2006 >

dotnet clr : Confusing networking exception


Jeffery Jones
3/30/2006 9:48:38 AM


Given - .NET 2.0, App 1 creates a TCP listening socket on 127.0.0.1
App 2 connects to the same socket on 127.0.0.1.

All works fine until the app is installed on another machine without
Visual Studio. Then the connecting client gets -

---- UnauthorizedAccessException ---------
Message: Access to the path 'Global\.net clr networking' is denied.
at System.Net.Sockets.TcpClient.Connect(String hostname, Int32
port)


The code was
remoteClient.Connect("127.0.0.1", RemotePort);


This *seems* like a Code Access Security - type of problem, except
that the app is installed and running on the C: drive. There is no
..NET 2.0 Framework configuration applet to even view what the
workstation settings are - they are as defaulted from installation.

What could be happening? I couldn't find any reference to the
jetan NO[at]SPAM online.microsoft.com (
3/31/2006 2:49:48 AM
Hi Jeffery,

Thanks for your post!

Based on my research regarding this exception, I did not find much useful
information. My finding appears that 'Global\.net clr networking' is an
internal mutex string which is used in .Net networking. However, this
information is not enough for us to identify the problem.

Have you tried the applications on other machines without VS2005 installed?
Does the problem still exist?

Can you provide the full call stack regarding this exception?

Additionally, if you think this issue should be caused by CAS. You can open
.Net Framework2.0 SDK command prompt, and use caspol.exe -s off to turn off
the machine's CAS temporarily.

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jeffery Jones
4/3/2006 12:00:00 AM
On Fri, 31 Mar 2006 02:49:48 GMT, jetan@online.microsoft.com ("Jeffrey
[quoted text, click to view]


Jeffery, The information that it is a mutex string is helpful and
I performed some additional tests to try to get more information.

On a second system, XP Home without VS2005 - Application works.

[quoted text, click to view]

ExceptionType: UnauthorizedAccessException
HelpLine:
Message: Access to the path 'Global\.net clr networking' is denied.
StackTrace: at System.Net.Sockets.TcpClient.Connect(String
hostname, Int32 port)
at RemoteInterop.RemoteInterface.ConnectToMasterController()
at RemoteInterop.RemoteInterface.StartDownload(String profileName)
at StartDownload.Program.Main(String[] args)
TargetSite: Void Connect(System.String, Int32)


The client socket gets as far as the network connect because the
server socket sees a connect, followed by an immediate disconnect
without any data.


[quoted text, click to view]

Here's where it gets interesting. The system with the problem is
Windows 2000 Professional with the login having only normal user
privileges (not administrator). Caspol.exe doesn't run in the normal
user account, so we logged in as administrator. The application then
worked without the Caspol.exe setting. So it seems that a normal
Windows 2000 user account lacks some privilege required for access to
the mutex 'Global\.net clr networking'.

I created a 'limited user account' on Windows XP Home, but the
application works there, so I was unable to narrow the issue further.

How do I find out what privilege is required for a limited Windows
2000 user to access the mutex 'Global\.net clr networking' ?

Thanks,

jetan NO[at]SPAM online.microsoft.com (
4/4/2006 12:00:00 AM
Hi Jeffery ,

Thanks for your feedback.

I will do some consulting internally to see if we can find more information
regarding your problem. I will reply to you ASAP. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
jetan NO[at]SPAM online.microsoft.com (
4/6/2006 12:00:00 AM
Hi Jeffery,

Sorry for letting you wait.

The feedback from our product team indicates that "Global\.net clr
networking" is a reference to the perf counter (that's the name of the perf
counter).

However, without reproducing this problem, it is hard for us to identify
the root cause of the problem.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jeffery Jones
4/27/2006 12:00:00 AM
On Fri, 31 Mar 2006 02:49:48 GMT, jetan@online.microsoft.com ("Jeffrey
[quoted text, click to view]


More information -
1.) The socket server task also dumped with a much more
informative stack trace. This is included below.
2.) Someone else had the problem and posted in this newsgroup. The
only thing in common was German Language, Windows 2000, and running as
an ordinary user. They solved their problem by going to XP.

Eventually, more people will encounter this problem. A
shrinkwrapped app cannot require the user to upgrade to XP. Perhaps
the shrinkwrap vendor can revert to the ugly mode and say 'our app
requires administrator privilege under Windows 2000'.


----------------------------------------------------------------------------------
ExceptionType: UnauthorizedAccessException
HelpLine:
Message: Access to the path 'Global\.net clr networking' is denied.
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)
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.SetToConnected()
at System.Net.Sockets.Socket.UpdateAcceptSocket(Socket socket,
EndPoint remoteEP, Boolean needCancelSelect)
at System.Net.Sockets.Socket.Accept()
at System.Net.Sockets.TcpListener.AcceptTcpClient()
at mcSimulator.RemoteControl.RemoteServerThread()

TargetSite: Void WinIOError(Int32, System.String)
jetan NO[at]SPAM online.microsoft.com (
5/2/2006 12:00:00 AM
Hi Jeffery,

Do you have the definite steps to reproduce the problem? If so, I suggest
you report it as a bug in the feedback link below:
http://lab.msdn.microsoft.com/productfeedback/default.aspx

Our product team will receive the bug request work with you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jeffery Jones
5/8/2006 7:32:29 AM
On Tue, 02 May 2006 09:25:08 GMT, jetan@online.microsoft.com ("Jeffrey
[quoted text, click to view]

I'll set this up. Thanks for the reporting address!
jetan NO[at]SPAM online.microsoft.com (
5/9/2006 3:12:02 AM
You are welcome.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Paul Horstink
6/12/2006 2:51:01 AM
Dear Jeffrey,

I have the same error on a Windows2000 system with regular user-account (I'm
not doing a 'connect' but I use try to consume a web-service).
Anyway, I also saw a message related to the messages realted to the
performance counter.
AddThis Social Bookmark Button