生成后事件复制不起作用 [英] Post-build event copy not working

查看:91
本文介绍了生成后事件复制不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个构建后事件,可使用以下命令在成功构建后将.dll从一个项目复制到另一个项目:

I have a post-build event to copy a .dll from one project to another on successful build using the following command:

复制$(TargetPath).... \ MainProject \ bin

copy $(TargetPath) ....\MainProject\bin

这在我的本地计算机上工作正常,但是在构建服务器上似乎失败,因为在构建MainProject时,我收到以下信息:

This works fine on my local machine, but it appears to be failing on the build server because when building the MainProject I receive the following:

警告MSB3245:无法解决此引用.无法找到程序集"Project2".检查以确保程序集在磁盘上.如果您的代码需要此引用,则可能会出现编译错误.

warning MSB3245: Could not resolve this reference. Could not locate the assembly "Project2". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

有人在构建后事件中遇到过复制命令的类似问题吗?

Has anyone experienced similar issues with the copy command in a post-build event?

推荐答案

该警告不是来自复制"任务,而是来自项目的构建.提高诊断级别,然后登录到文件(/fl/flp:v=diag;logfile=diag.txt),以查看警告的实际来源.

That warning isn't from the Copy task, it is from the build of a project. Crank up the diagnostic level and log to a file (/fl /flp:v=diag;logfile=diag.txt) to see where the warning is actually coming from.

这篇关于生成后事件复制不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆