views:

159

answers:

1

Hi all,

I have asp.net project in Visual Studio running in Windows Vista with UAC activated in standar user (not elevated).

When I try to run my asp.net project inside Visual Studio Web Server, the process hang and start using so much CPU. If i run Visual Studio elevated It's works perfectly.

Here is what the process is doing. It's seems that it's trying to access to 'Global.net clr networking' but it's not working.

0:000> !clrstack OS Thread Id: 0xcec (0) ESP EIP
0021f09c 6dd09742 [NDirectMethodFrameGeneric: 0021f09c] Microsoft.Win32.NativeMethods.CreateFileMapping(IntPtr, SECURITY_ATTRIBUTES, Int32, Int32, Int32, System.String) 0021f0bc 56a02b0d System.Diagnostics.SharedPerformanceCounter+FileMapping.Initialize(System.String, Int32, Int32) 0021f11c 56a02a30 System.Diagnostics.SharedPerformanceCounter+FileMapping..ctor(System.String, Int32, Int32) 0021f12c 56a05af7 System.Diagnostics.SharedPerformanceCounter.GetCategoryData() 0021f17c 56a056b8 System.Diagnostics.SharedPerformanceCounter..ctor(System.String, System.String, System.String, System.Diagnostics.PerformanceCounterInstanceLifetime) 0021f19c 56a0456c System.Diagnostics.PerformanceCounter.Initialize() 0021f1d0 56a0437f System.Diagnostics.PerformanceCounter.set_RawValue(Int64) 0021f1ec 569ca4d3 System.Net.NetworkingPerfCounters.Initialize() 0021f230 569c980a System.Net.Configuration.SettingsSectionInternal..ctor(System.Net.Configuration.SettingsSection) 0021f270 569e3201 System.Net.Configuration.SettingsSectionInternal.get_Section() 0021f29c 569e2aad System.Net.Sockets.Socket.InitializeSockets() 0021f2ec 569e24e8 System.Net.Sockets.Socket..ctor(System.Net.Sockets.AddressFamily, System.Net.Sockets.SocketType, System.Net.Sockets.ProtocolType) 0021f310 00370758 Microsoft.VisualStudio.WebHost.Server.Start() 0021f33c 0037037b Microsoft.VisualStudio.WebServer.WebServerApp.Main(System.String[]) 0021f594 6dce1b4c [GCFrame: 0021f594] 0:000> !finalizequeue SyncBlocks to be cleaned up: 0 MTA Interfaces to be released: 0

STA Interfaces to be released: 0

generation 0 has 104256 finalizable objects (045e06fc->046463fc) generation 1 has 1 finalizable objects (045e06f8->045e06fc) generation 2 has 22 finalizable objects (045e06a0->045e06f8) Ready for finalization 0 objects (046463fc->046463fc) Statistics: MT Count TotalSize Class Name 573bd7cc 1 20 Microsoft.Win32.SafeHandles.SafeFileHandle 56a4a3f0 1 20 Microsoft.Win32.SafeHandles.SafeLocalMemHandle 57395c34 1 44 System.Threading.ReaderWriterLock 573b8e74 1 56 System.Threading.Thread 56a3e224 1 76 System.Net.Sockets.Socket 56a49d30 1 120 System.Diagnostics.PerformanceCounter 57395bdc 8 128 System.WeakReference 57397ba0 8 160 Microsoft.Win32.SafeHandles.SafeRegistryHandle 56a4a448 104257 2085140 Microsoft.Win32.SafeHandles.SafeFileMappingHandle Total 104279 objects

A: 

When you run an ASP.NET project inside VS the debug webserver runs (as you say) without elevation which causes problems. Debugging is a privileged operation of exactly the sort that UAC is intended to suppress. The whole idea of UAC is that this sort of thing can't happen without your explicit intervention.

So run VS with elevated permissions. The behaviour you are seeing is by design.

Peter Wone
This is true when debugging IIS, when debugging a web application running in WebDev.WebServer.exe / Cassini, there's no need to run elevated. Both VS and the web server as running as the current user (you), and therefore you can debug the web application just as you could debug an executable without elevation.
Sander Rijken