Spodii / netgore

Cross platform online rpg engine using C# and SFML
http://www.netgore.com/
40 stars 16 forks source link

[Demo Game Server] InvalidOperationException not handeled. #317

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Problem: Server Crashes on startup, due to a unhandeled exception.
SVN Revision: 4518
Compiled with Visual Studio 2010 (Debug and Release tested)
OS: WIndows 7 Professional
---------------------------------------------------
The Problem occurs while creating a new cpuCounter:
at DemoGame.Server\UI\WinForms\frmMain.cs Line 75:

_cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
---------------------------------------------------
msdn reference:
http://msdn.microsoft.com/en-us/library/fd85b3df%28v=VS.100%29.aspx
---------------------------------------------------
Output is unfortunately in german:
System.InvalidOperationException wurde nicht behandelt.
  Message=Die Kategorie ist nicht vorhanden.
  Source=System
  StackTrace:
       bei System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
       bei System.Diagnostics.PerformanceCounter.InitializeImpl()
       bei System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
       bei System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName)
       bei DemoGame.Server.UI.frmMain..ctor() in E:\Netgore\4518\svn\DemoGame.Server\UI\WinForms\frmMain.cs:Zeile 75.
       bei DemoGame.Server.Program.Main(String[] args) in E:\Netgore\4518\svn\DemoGame.Server\Program.cs:Zeile 58.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

Original issue reported on code.google.com by Albinoamsel@googlemail.com on 1 Jul 2011 at 9:12

GoogleCodeExporter commented 9 years ago
Seems like this was not the only one, at least the server does not crash from 
this:
------------------------
Failed to create Memory performance counter: System.InvalidOperationException: 
Die Kategorie ist nicht vorhanden.
   bei System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
   bei System.Diagnostics.PerformanceCounter.InitializeImpl()
   bei System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
   bei System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName)
   bei NetGore.SystemPerformance.Memory..cctor() in E:\Netgore\4518\svn\NetGore\Core\SystemPerformance.cs:Zeile 163.

Original comment by Albinoamsel@googlemail.com on 1 Jul 2011 at 9:17

GoogleCodeExporter commented 9 years ago
Ok, I scribbled a dirty workaround together, I don't know where the Issue comes 
from, please check that so the Monitoring feature becomes usable again.

Original comment by Albinoamsel@googlemail.com on 1 Jul 2011 at 9:31

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by Spodiii on 29 Nov 2012 at 2:07

GoogleCodeExporter commented 9 years ago

Original comment by Spodiii on 30 Nov 2012 at 2:25