Visual Studio变量bin目录
我有一些在多个解决方案之间共享的 VS 2010 C# 项目。我希望将这些项目构建到它们打开的解决方案的目录中。我该如何执行此操作?
我考虑设置不同的构建配置(Debug_Xsln、debug_Ysln、Release_Xsln...),但不确定是否有更好的方法。
I have a few VS 2010 C# projects that are shared between several solutions. I would like these projects to build to the directory of the solutions they are open in. How do I do this?
I considered setting up different build configurations (Debug_Xsln, debug_Ysln, Release_Xsln...) but wasn't sure if there was a better way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://msdn.microsoft.com/en- us/library/42x5kfw4(v=VS.100).aspx
您可以将构建后事件与 xcopy 和宏
$(SolutionName)
或$(SolutionDir) 将编译后的文件复制到正确的文件夹中。
进入项目属性,构建事件选项卡,然后在构建后事件命令行中输入如下内容:
此方法的好处是您可以将一个项目的构建输出复制到多个位置
或
(正如 Ziplin 发现的那样)
如果您希望构建输出只有一个位置,则可以使用上面的宏来设置输出路径,如下所示:
只需转到“构建”选项卡上的项目属性,然后将宏位置设置为输出路径
http://msdn.microsoft.com/en-us/library/42x5kfw4(v=VS.100).aspx
You can use a postbuild event with xcopy and the macro
$(SolutionName)
or$(SolutionDir)
to copy the compiled files into the correct folder.Go into properties for the project, build events tab, and in Post Build event command line enter something like this:
The benefit of this method is you can copy the build output of one project to multiple locations
OR
(as Ziplin discovered)
If you only have one location you want the build output to go, you can use the macros above to set the output path, like this:
just go to the project properties on the build tab and set your macroed location as the output path