It seems to me that I fixed it earlier, but I do not remember how.
I have a task file that looks like this (CustomTasks.tasks):
<UsingTask AssemblyFile="CustomTasks.dll" TaskName="MyCustomTask"/>
it refers to the assembly (namely Ionic.Zip.dll). Ionic.Zip.dll is not located in the GAC (and I do not want it to be). It is located next to my CustomTasks.dll.
I have a directory called MSBuild one level from my sln file, which has CustomTasks.tasks, CustomTasks.dll and Ionic.Zip.dll.
I have csproj that references a task file and calls a custom task:
<Import Project="$(ProjectDir)\..\MSBuild\CustomTasks.tasks" /> <MyCustomTask ..... />
during assembly, this gives:
The task "MyCustomTask" cannot be loaded from the assembly ... MyCustomTasks.dll. Failed to load file or assembly "Ionic.Zip, ......" or one of its dependencies.
msbuild msbuild-task
Jeff Nov 25 '12 at 6:30 2012-11-25 06:30
source share