R – How to solve: Custom MSBuild task requires assembly outside of AppBase

assembly-resolutionfusionmsbuildtask

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.

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.

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.

UPDATE: Well, it seems I'll go with using a copy afterall. Other solutions all require system-wide modifications, which isn't really warranted here.

Best Answer

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.