title: How to make the Visual Studio compiler ignore a file?
body: <p>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 file - it's just a text file.  During compiling VS grabs a hold of the file and bombs.  </p>
  
  <p>I'd like for it to act as though it's just a text file.  I do not have the option of changing the name of the file.</p>
  
  <p>EDIT: Please note that BuildAction does not exclude files from the compiler checking them.  It simply decides if the file is compiled into the assembly, whether it's content (like a jpg or something), or whether it is a resource file.  For more info: <a href="http://msdn.microsoft.com/en-us/library/0c6xyb66(VS.80).aspx" rel="noreferrer">see the MSDN page</a>.</p>
  
  <p>EDIT2: Apparently, if you have a text file that is named foo.config and you have it open while building, VS2005 will pop up an error thinking that the file should be xml.  However, if you close the file, VS2005 will ignore it.</p>
  
  <p>Solution: Visual Studio validation causes errors if you have a non-compliant file open during build time.  For an example of how to turn this off (for HTML), see <a href="http://weblogs.asp.net/scottgu/archive/2005/11/23/431350.aspx" rel="noreferrer">Scott Guthrie's post</a>.  As Allen mentioned, you should also have the Build Action turned to "None".  Unfortunately, this will not stop build errors if you have the file open.</p>