且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用.inf文件复制到输出目录问题

更新时间:2022-10-20 19:04:46

是的,默认的Build Action是Resource。 .inf文件扩展名是注册文件类型,用于即插即用安装程序。 c:\windows\inf满了他们。只需将自己的生成操作更改为无或使用不同的文件扩展名。

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.

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.