DNN 模块升级

最近升级DNN的模块到支持新版本的开发,具体的步骤如下。修改csproj文件:
1、将3.5修改为4.0
2、将v4.0修改为v4.5.1
3、修改Import:

1
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />

修改为

1
2
3
4
5
6
7
<Import Project="..\DNNArticle\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('..\DNNArticle\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\DNNArticle\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\DNNArticle\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets'))" />
</Target>

拷贝packages.config:

1
2
3
4
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSBuildTasks" version="1.5.0.235" targetFramework="net451" developmentDependency="true" />
</packages>

修改ModulePackage.targets:
1、增加
2、 DestinationFolder=”packages/“修改为DestinationFolder=”mypackages/
修改MSBuild.Community.Tasks.Targets

1
<MSBuildCommunityTasksLib>$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll</MSBuildCommunityTasksLib>

修改为

1
<MSBuildCommunityTasksLib>$(SolutionDir)\packages\MSBuildTasks.1.5.0.235\tools\MSBuild.Community.Tasks.dll</MSBuildCommunityTasksLib>