visual-studio-2015windows-8enterprise-libraryenterprise-library-6

How to rebuild Enterprise Library 6 on Win 8 and VS2015


I have customized the Enterprise Library and now want to rebuild it, but I get some errors when executing the BuildLibrary.bat (Scripts folder) from Developer Command Prompt for VS2015.

Environment:

  1. Win 8
  2. VS2015

Two issues:

1.)

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

On my system I have a newer version:

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]


Solution

  • Ok I solved it by overriding the toolsversion. Didn't use the BuildLibrary.bat.

    Executed msbuild directly with the following switches:

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

    If you want the Release version, replace debug with release.

    P.S.: What I also did, was upgrading all projects to use .NET 4.6.1. But I think, overriding the tv is enough.