To make debugging from Visual Studio possible, a few things must be configured correctly.

Project Settings

Build Events

Add a Post-build event to create a Plugins sub-folder and copy you plugin dll there, where XrmToolBox can find the plugin assemblies.

Project Post-build event

Sample post-build event:

if $(ConfigurationName) == Debug (
  IF NOT EXIST Plugins mkdir Plugins
  move /Y MyLittleCompany.*.dll Plugins
)

Alternative, more generic, post-build event:

IF NOT EXIST Plugins mkdir Plugins
move /Y $(TargetFileName) Plugins

Debug

Define external program to start for debugging.

Project Debug program

Sample path:

C:\Dev\Labb\MyXTBPlugin\MyXTBPlugin\bin\Debug\XrmToolBox.exe

Command line arguments used to specify the current working folder for XrmToolBox:

/overridepath:.

Recommended Debug Configuration

Argument Description
/overridepath:.
This specifies that you wan't to use the build folder as the root folder for XrmToolBox and not the user's AppData.
/connection:"[Connection Name]" The organization that XrmToolBox should connect to when it starts.
/plugin:"[Plugin Name]" The name of the plugin you are developing. This is the value in ExportMetaData attribute.