Pure.Krome
Pure.Krome

Reputation: 87087

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?

Upvotes: 3

Views: 340

Answers (1)

JaredPar
JaredPar

Reputation: 755587

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

Upvotes: 0

Related Questions