如何解决:自定义MSBuild任务需要在AppBase之外进行组装 [英] How to solve: Custom MSBuild task requires assembly outside of AppBase

查看:104
本文介绍了如何解决:自定义MSBuild任务需要在AppBase之外进行组装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义任务,在构建C#项目时要执行.该任务位于MyTask.dll中,该任务引用了另一个程序集MyCommon.DLL.

I have a custom Task that I want to execute when building my C# projects. This task is located in MyTask.dll, which references another assembly, MyCommon.DLL.

问题是MyCommon.dll相对于MyTask.dll位于".. \ Common \ MyCommon.dll"处,这使它位于MSBuild进程的AppBase目录之外.通过分析MSBuild的日志并查看Fusion的绑定失败报告,我已经确认这确实是问题.

The problem is that MyCommon.dll is located at "..\Common\MyCommon.dll" relative to MyTask.dll, which puts it outside the AppBase dir for MSBuild process. I've confirmed that this is indeed the problem by analyzing MSBuild's log and seeing Fusion's report about the binding failure.

在构建过程中,我应该怎么做才能使Fusion找到MyCommon.dll?请注意,移动程序集会破坏我的应用程序,这也取决于它.

What can I do to make Fusion find MyCommon.dll during the build process? Note that moving the assembly would break my app, which also depends on it.

更新:好吧,毕竟我似乎会继续使用副本.其他解决方案都需要在系统范围内进行修改,此处并不需要这样做.

推荐答案

那么复制它吗?只是一个想法.在那里有一个副本只是为了支持您在完成构建后删除的构建.

So copy it instead? Just a thought. Have a copy there just to support the build that you delete once you're done with it.

这篇关于如何解决:自定义MSBuild任务需要在AppBase之外进行组装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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