简体   繁体   中英

Can I tell MSBuild where to look for assemblies?

I have a UsingTask which is a dll .. that references some dll which is NOT in the same directory as the using-task-dll.

eg.

<UsingTask TaskName="FooAwesome" AssemblyFile="$(SolutionDir)packages\\FooAwesome\\lib\\NET20\\FooAwesome.dll" />

Error: FooAwesome.dll requires Foo.Core.dll

And the Core does exist ...

\Solution
    \packages
        \FooAwesome
        \Foo.Core

So how can i tell me msbuild.proj file, that even though i'm using FooAwesome .. i know that it needs Foo.Core and it can find that dll ... ~here~.

Possible?

In order to make this work you'd need to change the assembly probing behavior of MsBuild. To my knowledge there is on way to do that. I think your best options here are the following

  1. Use ILMerge so that the task is contained in one assembly
  2. Strongly name + GAC the assemblies which will allow them to be found during probing

Personally I would opt for #1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM