Reputation: 630
I'm trying to make DNN module FormAndList (aka UserDefinedTable) to compile while I included it's project into solution, which is placed in different directory (3 folders up). And I edited MSBuild.Community.Tasks.Targets
file so that it would find correct path to library MSBuild.Community.Tasks.dll
. And it works for Debug mode, but when I compile it in Release mode it gives me this error:
The "MSBuild.Community.Tasks.XmlRead" task could not be loaded from the assembly D:\Projects\SolutionFolder\Host\DesktopModules\UserDefinedTable\BuildScripts\MSBuild.Community.Tasks.dll. Could not load file or assembly 'file:///D:\Projects\SolutionFolder\Host\DesktopModules\UserDefinedTable\BuildScripts\MSBuild.Community.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
I compared both MSBuild.Community.Tasks.Targets
and ModulePackage.targets
files with another module, which works perfectly, but I didn't find any crutial difference between them.
Problem is that during compilation it tries to find MSBuild.Community.Tasks.dll
iside folder where build scripts are, but it should search for it in D:\Projects\SolutionFolder\packages\MSBuildTasks.1.5.0.235\tools
.
I already edited all places that I found with path's in .csproj and MSBuild.Community.Tasks.Targets
but it works only for Debug mode. What am I missing?
Upvotes: 1
Views: 399
Reputation: 1572
In your projects you have something like:
<Import Project="..\..\..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('..\..\..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" />
and
<Import Project="packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" />
I don't think you need those lines.
also try to use:
<MSBuildCommunityTasksPath>$(SolutionDir)\packages\MSBuildTasks.1.5.0.235\tools</MSBuildCommunityTasksPath>
Upvotes: 1