Ich habe da ein Problem. Ich will die Prozessorauslastung mit diesem Code anzeigen lassen. Funktionierte alles Perfekt als ich es auf einem neuen Form getestet habe. Jetzt hab ich den Code auf meinem Hauptform eingefügt, umgeschrieben und dann kommt der Fehler: CategoryName ist nicht vorhanden.
Ich habe den Fehlerbericht mal hier eingefügt:
CODE
System.InvalidOperationException wurde nicht behandelt.
Message="Fehler bei der Initialisierung. CategoryName ist nicht vorhanden."
Source="System"
StackTrace:
bei System.Diagnostics.PerformanceCounter.Initialize() bei System.Diagnostics.PerformanceCounter.NextSample() bei System.Diagnostics.PerformanceCounter.NextValue() bei WindowsApplication1.Hauptform.Timer4_Tick(Object sender, EventArgs e) in C:\Users\Felix\Documents\Visual Studio 2008\Projects\WindowsApplication7\WindowsApplication7\Form1.vb:Zeile 124. bei System.Windows.Forms.Timer.OnTick(EventArgs e) bei System.Windows.Forms.Timer.TimerNativeWindow.WndPr
oc(Message& m) bei System.Windows.Forms.NativeWindow.DebuggableCallba
ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) bei System.Windows.Forms.UnsafeNativeMethods.DispatchM
essageW(MSG& msg) bei System.Windows.Forms.Application.ComponentManager.
System.Windows.Forms.UnsafeNativeMethods.IMsoCompon
entManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) bei System.Windows.Forms.Application.ThreadContext.Run
MessageLoopInner(Int32 reason, ApplicationContext context) bei System.Windows.Forms.Application.ThreadContext.Run
MessageLoop(Int32 reason, ApplicationContext context) bei System.Windows.Forms.Application.Run(ApplicationCo
ntext context) bei Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.OnRun() bei Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.DoApplicationModel() bei Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.Run(String[] commandLine) bei WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81. bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) bei Microsoft.VisualStudio.HostingProcess.HostProc.Run
UsersAssembly() bei System.Threading.ThreadHelper.ThreadStart_Context(
Object state) bei System.Threading.ExecutionContext.Run(ExecutionCon
text executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart()
InnerException:
Wie behebe ich das wieder?
Mfg Mr.X