如何在 Win 8 和 VS2015 上重建 Enterprise Library 6

How to rebuild Enterprise Library 6 on Win 8 and VS2015

我已经自定义了企业库,现在想重建它,但是在从 VS2015 开发人员命令提示符执行 BuildLibrary.bat(脚本文件夹)时出现一些错误。

环境:

  1. 赢 8
  2. VS2015

两期:

1.)

Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft. Build.Tasks.v12.0.dll

在我的系统上我有一个更新的版本:

Microsoft.Build.Tasks.v4.0.dll


2.)

"C:\EntLib6Source\Blocks\EnterpriseLibrary.sln" (Rebuild target) (1) -> "C:\EntLib6Source\Blocks\SemanticLogging\Src\SemanticLogging.Database\SemanticLogging.Database.csproj" (Rebuild target) (53) -> "C:\EntLib6Source\Blocks\TransientFaultHandling\Source\TransientFaultHandling\TransientFaultHandling.csproj" (Clean target) (35:11) -> C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(283,22): error MSB4086: A numeric comparison was attempt ed on "10.0.11000.0" that evaluates to "10.0.11000.0" instead of a number, in condition "'$(TargetPlatformVersion)' >= '10.0.11000.0'". [C:\EntLib6Source\Blocks \TransientFaultHandling\Source\TransientFaultHandling\TransientFaultHandling.csproj]


"C:\EntLib6Source\Blocks\EnterpriseLibrary.sln" (Rebuild target) (1) -> "C:\EntLib6Source\Blocks\SemanticLogging\Src\SemanticLogging\SemanticLogging.csproj" (Rebuild target) (52) -> (CheckPrerequisites target) ->
C:\EntLib6Source\Blocks.nuget\nuget.targets(71,9): error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Windows\Micros oft.NET\Framework\v4.0.30319\Microsoft.Build.Tasks.v12.0.dll". Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft. Build.Tasks.v12.0.dll' or one of its dependencies. The system cannot find the file specified. [C:\EntLib6Source\Blocks\SemanticLogging\Src\SemanticLogging\Seman ticLogging.csproj]

好的,我通过覆盖工具版本解决了这个问题。 没有使用 BuildLibrary.bat.

直接使用以下开关执行 msbuild:

msbuild.exe EnterpriseLibrary.sln /tv:14.0 /p:Configuration=Debug

如果你想要Release版本,把debug换成release。

P.S.: 我还做了,升级所有项目以使用 .NET 4.6.1。 不过我觉得,覆盖电视就够了。