Make sure to compile your project using the Debug option from the Solution Configurations list box.
When generating a new pattern make sure to enable the Debugging options for Patterns.
Set the project as the Startup one in Visual Studio and configure the GeneXus.exe complete path in the Project -> Properties -> Debug -> Start action -> Start external program.