Hello,
I just installed your template for VS2017.
I create a new module.
I can compile perfectly
In csproj, the end the file:
<PropertyGroup>
<Extension>zip</Extension>
<DNNFileName>DNNModuleTest</DNNFileName>
<PackageName>DNNModuleTest</PackageName>
</PropertyGroup>
<Import Project="BuildScripts\ModulePackage.Targets" />
<Target Name="AfterBuild" DependsOnTargets="PackageModule">
</Target>
</Project>
in package.config, the following line:
<package id="MSBuildTasks" version="1.5.0.235" targetFramework="net45" developmentDependency="true" />
Then, I execute the command in package.console:
update-package MSBuildTasks -reinstall
to force the right target
MSBuildTasks remains the same version but the target is: "net451"
now the package.config contains:
<package id="MSBuildTasks" version="1.5.0.235" targetFramework="net451" developmentDependency="true" />
now, the csproj has been modified to become:
<PropertyGroup>
<Extension>zip</Extension>
<DNNFileName>DNNModuleTest</DNNFileName>
<PackageName>DNNModuleTest</PackageName>
</PropertyGroup>
<Import Project="BuildScripts\ModulePackage.Targets" />
<Target Name="AfterBuild" DependsOnTargets="PackageModule">
</Target>
<Import Project="..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets'))" />
</Target>
</Project>
When I compile then, I got following error:
Severity Code Description Project File Line Suppression State
Error The "MSBuild.Community.Tasks.XmlRead" task could not be loaded from the assembly q:\Websites\Modules\CNoteV1\DNNModuleTest\BuildScripts\MSBuild.Community.Tasks.dll. Could not load file or assembly 'file:///q:\Websites\Modules\CNoteV1\DNNModuleTest\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. DNNModuleTest
I check the MSBuild.Community.Tasks.Targets file in BuildScript folder and the MSBuildTasks package folder, and there are not identical:
the one from package:
The one from module project:
The content lines are different too inside the <usingtask, not all files exist in the 2 files.
I tried to copy the one new one inside the project but the error persists.
I spent long hours reading forum articles and trying everything and finally the only way to compile is to remove manually the lines inside the .csproj to revert as the original template.
It could be great in future version of the template to support latest version of dependency nuget package.
Thanks in advance and thanks for your support
-Vince