Visual Studio 2008: How do I include project output as an embedded resource in another project?

柔情痞子 提交于 2019-12-05 04:19:46

When you add an existing file to a project, Visual Studio copies the file into the project's directory.
Any subsequent changes to the original file are ignored.

There are two workarounds:

  • Add a post-build action to the first project that copies its output file to the second project, and edit the dependencies so that the first project is always built first.

  • Add the output file to the second project as a link (Click the down arrow next to the Add button in the open dialog).
    This will reference the file from its original location without making any copies.

the best option is to "reference" the other project as if it were a class library. that way you make sure the whole references tree is copied to your output dir.

Set the output directory of the project that generates the resource to point to the resource directory in the project that uses it.

If that's not possible for some reason, use a post-build command (also available in the project settings) to copy the file there.

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