DotPurpleApp / DotPurple-App

Bug reports, feature requests, and tool list for DotPurple -- the only cross-platform GUI for the .NET (dotnet) command-line interface (CLI)
https://dotpurple.io
24 stars 0 forks source link

[Bug] Application crashes immediately after start #6

Closed Mrxx99 closed 1 year ago

Mrxx99 commented 1 year ago

Describe the bug I installed DotPurple, but when I try to launch it nothing happens, the app does not show up at all, only noticed that it is because of a crash while looking at the event log

To Reproduce Steps to reproduce the behavior: I guess it is not reproducable for others but:

  1. Install DotPurple
  2. Try to start the app
  3. Nothing happens

Expected behavior The app starts

Desktop (please complete the following information):

Additional context

Exception stacktrace > Application: DotPurple.exe > Frameworkversion: v4.0.30319 > Description: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet. > Exception information: System.ArgumentException > at System.Collections.Hashtable.Insert(System.Object, System.Object, Boolean) > at DotPurple.Helpers.CommandRunner+d__11.MoveNext() > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) > at DotPurple.Helpers.CommandRunner+d__12.MoveNext() > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) > at DotPurple.Helpers.Utilities+d__4.MoveNext() > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) > at DotPurple.App+d__5.MoveNext() > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) > at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) > at System.Windows.Threading.DispatcherOperation.InvokeImpl() > at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object) > at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) > at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) > at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) > at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object) > at System.Windows.Threading.DispatcherOperation.Invoke() > at System.Windows.Threading.Dispatcher.ProcessQueue() > at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) > at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) > at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) > at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) > at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) > at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) > at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) > at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) > at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) > at System.Windows.Application.RunDispatcher(System.Object) > at System.Windows.Application.RunInternal(System.Windows.Window) > at DotPurple.App.Main()
Deadpikle commented 1 year ago

Hi @Mrxx99,

Thanks so much for reporting this. Until people report, sometimes we have no clue that something is wrong. :) Thank you!

Sorry to hear you're having issues. I'm extremely busy right now, but will try to help you out as quick as I can. The stack trace is sort of helpful, but can you also see if there is a stack trace at %APPDATA%/DotPurple/crashes and upload them if they are there?

(Perchance do you not have the dotnet SDK installed? I wonder if it's failing somehow without it, as that is one of the first things that takes place. :thinking:)

Deadpikle commented 1 year ago

Here is a debug build for you to try, too, based on the stack trace you provided. Please give it a shot.

DotPurpleDebug.zip

Deadpikle commented 1 year ago

Actually, after scouring the code file (based on the exception) for what could throw that specific exception, I may have found it. Try this debug build too, if you don't mind, and if it fixes it, did you have any dotnet variables in your environment?

DotPurpleDebug2.zip

Mrxx99 commented 1 year ago

Of course I have the .NET SDK installed otherwise this app would not make any sense to use :D

Here is the stacktrace from the crash report:

stacktrace ``` DotPurple v1.10.0.0 Operating System:WindowsWPF | Microsoft Windows NT 10.0.19045.0 | 2009 Crash Report --------------- Das Element wurde bereits hinzugefügt. Schlüssel im Wörterbuch: "DOTNET_CLI_UI_LANGUAGE". Hinzuzufügender Schlüssel: "DOTNET_CLI_UI_LANGUAGE". bei System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) bei DotPurple.Helpers.CommandRunner.d__11.MoveNext() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei DotPurple.Helpers.CommandRunner.d__12.MoveNext() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei DotPurple.Helpers.Utilities.d__4.MoveNext() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei DotPurple.App.d__5.MoveNext() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) bei System.Windows.Threading.DispatcherOperation.InvokeImpl() bei MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) bei System.Windows.Threading.DispatcherOperation.Invoke() bei System.Windows.Threading.Dispatcher.ProcessQueue() bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) bei System.Windows.Application.RunDispatcher(Object ignore) bei System.Windows.Application.RunInternal(Window window) bei DotPurple.App.Main() ```

(the part beginning with bei System.Windows.Threading.DispatcherOperation.InvokeImpl() is only part of some stacktraces)



Both the provided Debug builds do also crash. The first shows a popup with the same stacktrace as provided above, the second opens a "DotPurple Crash Reporter" window.

But I have an idea why this is happening for me. My PC culture is set to German, but because I wanted the help in dotnet CLI to be in english I have set the DOTNET_CLI_UI_LANGUAGE environment variable to "en" and that seems to somehow cause the crash.

EDIT: The second debug build starts without crash after showing the "DotPurple Crash Reporter"

Deadpikle commented 1 year ago

But I have an idea why this is happening for me. My PC culture is set to German, but because I wanted the help in dotnet CLI to be in english I have set the DOTNET_CLI_UI_LANGUAGE environment variable to "en" and that seems to somehow cause the crash.

That's what was causing the problem, yes. The DotPurple code didn't account for these already being set when it was running commands, so it failed here.

Thank you for testing those debug builds. Sounds like the second one works. I will do my best to upload a new build to the actual website as soon as I can and will keep this ticket open until I do so. :) Thank you again for reporting!

Deadpikle commented 1 year ago

All fixed and uploaded new builds. Thank you!