C# – Copy to output directory issue with .inf file

cfile-iovisual-studio-2008wpf

Apologies if dup, I did try searching several times and found nothing like it…

I have a number of 'config' files that my application edits. Really it is just a gui for editing these files as they have a special format. Anyway, everytime I put a new group of files in visual studio, and select "Copy to Output directory" to "Copy always", this works fine. Except all other files will have "Build Action" set to "None" except the .inf file which will always have "Build Action" set to "Resource"…and this causes it to not be copied to the output directory (as far as I can tell).

I think I must be missing something here, as it seems VS is doing this on purpose, so perhaps I am not following best practice each time I change its build action back to none – to have it copied to the output directory just like all the other files.

Thanks.

Best Answer

Yes, the default Build Action is "Resource". The .inf filename extension is a registered file type, it is used for plug-and-play installers. c:\windows\inf is full of them. Just change the Build Action to None yourself or use a different filename extension.