开发者

Is it possible to "collapse" content file paths in build output in visual studio?

I'm using an open source library (log4net) that comes with LICENSE, NOTICE, and README files that are supposed to be included when you distribute it. So I want to make visual studio put them in the output directory along with my binaries.

I have log4net and its three files in a "lib\log4net" dir. The problem is if I add the files as content files, they get copied to bin\release\lib\log4net, not bin\release. 开发者_JS百科 Is there any way to make visual studio collapse the paths when building?

I originally used a post-build step to copy them, but then visual studio isn't aware of them and it won't put them in any other dependent project's output folder (which it will do if you call them content).


You could use a post-build step on your project and just move them to the directory you want them in. I frequently use pre-build steps to bring in the latest versions of dependencies and post-build steps to arrange my project the way I want to deploy it.


If you are using an install project to package everything, what about adding the extra files directly to that instead?


All you have to do is right click the file, README, for example, and go to properties. One of the properties is "Copy to output directory". Set it to true.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜