How to make the Visual Studio compiler ignore a file?

前端 未结 4 700
死守一世寂寞
死守一世寂寞 2020-12-16 01:39

Is anyone aware of a way to make visual studio completely ignore a file when compiling? I have a C# solution that has a foo.config file that isn\'t really a standard config

4条回答
  •  时光说笑
    2020-12-16 02:20

    The action to take depends on the solution and and file type. For instance (in VS2005), in a C++ solution I can right click on the source file name in the solution explorer and view its properties. The first "General" option is "Excluded From Build", which will allow you to exclude the file from the build process without having it excluded from the project altogether.

    I pulled up a .config file in a C# solution, and found a "Build Action" option under the Advanced section. That should probably be set to "None".

提交回复
热议问题