I want to create a folder inside a C# project to contain some configuration files. However, I don't want these files to be copied to bin\Release\MyFolder
. I'd rather have them copied to bin\Release
directly. I'm thinking this may be doable by having a "virtual" folder, like solution folders, but I don't know how to do it.
我想在C#项目中创建一个文件夹来包含一些配置文件。但是,我不希望将这些文件复制到bin \ Release \ MyFolder。我宁愿把它们直接复制到bin \ Release。我认为这可能是可行的,有一个“虚拟”文件夹,如解决方案文件夹,但我不知道如何做到这一点。
Is there a way to create a virtual folder in Visual Studio 2008 (C#) projects? Or even better, how can I specify that the (text) file output should be directed to the main output folder?
有没有办法在Visual Studio 2008(C#)项目中创建虚拟文件夹?或者甚至更好,我如何指定(文本)文件输出应该指向主输出文件夹?
2 个解决方案
#1
Copy the file with a Post-build event.
使用Post-build事件复制文件。
#2
In the Solution view (View|Solution Explorer), right-click on a project and select Add -> New Filter. Type in a name for the filter (which looks like a folder in your project) and then you can add existing files to the filter by right-clicking and selecting Add -> Existing Item.
在Solution视图(View | Solution Explorer)中,右键单击项目并选择Add - > New Filter。输入过滤器的名称(看起来像项目中的文件夹),然后右键单击并选择添加 - >现有项目,即可将现有文件添加到过滤器。
#1
Copy the file with a Post-build event.
使用Post-build事件复制文件。
#2
In the Solution view (View|Solution Explorer), right-click on a project and select Add -> New Filter. Type in a name for the filter (which looks like a folder in your project) and then you can add existing files to the filter by right-clicking and selecting Add -> Existing Item.
在Solution视图(View | Solution Explorer)中,右键单击项目并选择Add - > New Filter。输入过滤器的名称(看起来像项目中的文件夹),然后右键单击并选择添加 - >现有项目,即可将现有文件添加到过滤器。