views:

155

answers:

1

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.

+1  A: 

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.

Hans Passant
Thanks, I know the solution, my question was more based on why it decides to automatically do that and what the "Resource" build action means. Seems to me they are expecting different usage of the file which is why it happens automatically
baron
As I said, it is a registered filename extension, just like .txt. The Resource build action embeds the file in final .exe or .dll. That can be useful sometimes. Look up GetManifestResourceStream().
Hans Passant
Ah-ha! thank you for the tip
baron