This always happens to me in visual studio. You can set the sandbox to ask you what to do instead of running automatically. Then after you compile a program, when it runs just select "Open Normally" and check "Remember my answer".
1. Open up avast UI.
2. Click additional protection.
3. Click Auto Sandbox.
4. In the Auto Sandbox page, click settings.
5. At the top of the settings window, change "Auto Sandbox Mode" to ask.
6 Done