Compilation errors after removing an Arduino file from a Visual Studio project

by Visual Micro 3. October 2011 13:32

Removing a file from a Visual Studio project does not remove the file from the Arduino sketch. You have to follow the Arduino rules when working with Arduino projects in Visual Studio.

The Visual Studio Arduino compiler entirely mimics the Arduino development system which doesn't know about Visual Studio projects. The Arduino system uses all of the source code files in a folder.

So you must move or delete your unwanted Arduino source files.


After removing files from a Visual Studio Arduino project, if you close and re-open the project, you will notice that the files you removed re-appear. This is because the Arduino for Visual Studio application validates Arduino projects when they are opened (applying the Arduino rules). The intention is to ensure compatibility with the Arduino development tool allowing you optionally compile sketches in either product.