FritzAndFriends/StreamDeckToolkit

Debugging

AlexHedley opened this issue · 2 comments

What's the best way to debug the plugin?

Is it enough to add:

public static void Main(string[] args)
{
#if DEBUG
   System.Diagnostics.Debugger.Launch(); 
#endif
    
   // code
}

p.s. I'll add it to Docs

https://twitter.com/JamesMontemagno/status/1312097488627732481

@csharpfritz is it possible to debug the Stream Deck Plugins with your toolkit? I am just using dotnet run and it installs fine, but not sure how to debug things.

@jamesmontemagno Yes, there is a hook in the startup of the plugin that will trigger the debugger if you pass a "-break" command-line argument:

https://github.com/FritzAndFriends/StreamDeckToolkit/blob/dev/src/StreamDeckLib.Config/ConfigurationBuilder.cs#L19


Also:

https://github.com/FritzAndFriends/StreamDeckToolkit/blob/dev/src/SamplePlugin/SamplePlugin.cmd

cd %appdata%\Elgato\StreamDeck\Plugins\com.csharpfritz.samplePlugin.sdPlugin SamplePlugin.exe -break %*

i could never figure it out. i need a video