Since we can only build a few clip DLLs, rather than the whole ScreenMonkey executable, we cannot simply debug our project. With VisualStudio Pro we can attach to a running ScreenMonkey, but this is not possible from the Express UI. Instead, we have to manually edit our .csproj file.

First exit VisualStudio and ScreenMonkey. Find your .csproj file, e.g. ScreenMonkey.Plugin.Clips.Song.csproj, and open it in a text editor. Look for the line that starts the default debugging PropertyGroup:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Under that, add these two lines, adjusting the Program Files path as necessary:
<StartProgram>C:\Program Files\Screen Monkey\ScreenMonkey.exe</StartProgram>

Save the file and open it in VisualStudio. Build your project, and copy your debug DLL and its PDB from Visual Studio 2010\Projects\ScreenMonkey\Screen Monkey Plugins\Clips\bin\Debug\Plugins\Clips to C:\Program Files\Screen Monkey\Plugins\Clips. Now when you debug, VisualStudio will start up ScreenMonkey, which will happily find a DLL for your clip type where it expects it, VisualStudio will be happy because it's a debug DLL, and you'll be happy because when you edit and continue, VisualStudio magically switches to use the DLL from your debug build directory. At least that's what seems to be happening!

Based on information here:

Last edited Oct 3, 2011 at 11:18 PM by stevekmcc, version 1


No comments yet.