[英]Move files/resources to the bin folder in Visual Studio
I have a C#
console app in VS 2017 and inside this I have a folder called libs
. 我在VS 2017中有一个C#
控制台应用程序,在其中有一个名为libs
的文件夹。 This contains some dlls
that I need to be copied to the bin folder upon compilation of the project. 其中包含一些dlls
,在项目编译时需要将这些dlls
复制到bin文件夹中。
VS copies this to /bin/libs/
at the moment. VS现在将其复制到/bin/libs/
。 Is there a way to configure it to put these files directly into /bin/
instead? 有没有一种方法可以配置它直接将这些文件放到/bin/
?
The dlls are set to Build Action: None
and Copy to Output Directory: Copy Always
dll设置为“ Build Action: None
并Copy to Output Directory: Copy Always
A common way to do this is to use a Post-Build event (under Project -> Properties -> Build Events) to xcopy the files. 一种常见的方法是使用后构建事件(在“项目”->“属性”->“构建事件”下)对文件进行xcopy 。 That's as about 'builtin' as you are going to get. 就像您将要获得的“内置”一样。
eg 例如
xcopy /y /r $(TargetDir)$(TargetFileName) $(ProjectDir)..\DestFolder\$(TargetFileName)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.