Place files from project sub-folder into output directory

大憨熊 提交于 2019-12-08 03:45:38

问题


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.

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?


回答1:


Copy the file with a Post-build event.




回答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.



来源:https://stackoverflow.com/questions/479074/place-files-from-project-sub-folder-into-output-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!