简体   繁体   English

将文件/资源​​移动到Visual Studio中的bin文件夹

[英]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: NoneCopy 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)

Common Macros for Build Commands and Properties 生成命令和属性的通用宏

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio中的资源文件夹 - Resources folder in Visual Studio 将Visual Studio资源文件放在“资源”以外的文件夹中? - Place Visual Studio resource files in a folder other than 'Resources'? Visual Studio转到bin和obj文件夹中的所有打开的文件,即使我在Visual Studio中也将它们排除在外 - Visual Studio Go to All open files from bin and obj folder even I exclude them in Visual Studio Visual Studio不刷新bin文件夹 - Visual studio does not refresh the bin folder Visual Studio 2019 未创建 OBJ 或 BIN 文件夹 - Visual Studio 2019 not creating OBJ or BIN folder 如何在Visual Studio 2010中的项目文件夹中访问bin / debug中的文件? - How to access the files in bin/debug within the project folder in Visual studio 2010? Visual Studio 2008 - 将构建时的文件移动到bin / - Visual Studio 2008 - Moving files at build to bin/ Visual Studio在打开Web应用程序解决方案时创建bin文件夹? - Visual Studio creates bin folder on opening web application solution? 如何在bin / Release for Visual Studio Project中创建文件夹? - How to create a folder in bin/Release for Visual Studio Project? 自动将本机dll复制到Visual Studio中引用项目的bin文件夹中 - Automaticaly copy native dll to the bin folder of referencing project in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM