2017-01-18 22 views
0

CIパイプラインでSSDTから.sqlprojプロジェクトをビルドするために使用するWindows Server 2012 R2があります。インストール済みnugetコマンドライン「ヘッドレス」構築サーバーでSSDTプロジェクトを構築するにはどうすればよいですか?

  • インストールnugetパッケージMicrosoft.Data.Tools.Msbuild

私は

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe database.solution.sln /p:tv=14 /p:SSDTPath=D:\Nuget\Microsoft.Data.Tools.Msbuild\lib\net40 /p:SQLDBExtensionsRefPath=D:\Nuget\Microsoft.Data.Tools.Msbuild\lib\net40 /p:Configuration=Debug

と私のソリューションを構築すると私が手:これは私がこれまで何をやったかでありますエラーメッセージCould not load file or assembly 'Microsoft.Build.Utilities.Core

私が逃したアイデアは?目標はできるだけ軽くなるようにサーバーを構築し、Visual StudioまたはSSDTをインストールしたくないということです。

はここのMSBuildからフル出力です:

Microsoft (R) Build Engine version 4.6.1586.0 
[Microsoft .NET Framework, version 4.0.30319.42000] 
Copyright (C) Microsoft Corporation. All rights reserved. 

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. 
Build started 18/01/2017 17:00:19. 
Project "D:\Jenkins\workspace\hcg\database.solution\database.solution.sln" on node 1 (default targets). 
ValidateSolutionConfiguration: 
    Building solution configuration "Debug|Any CPU". 
Project "D:\Jenkins\workspace\hcg\database.solution\database.solution.sln" (1) is building "D:\Jenkins\workspace\hcg\database.solution\database.solution\database.solution.sqlproj" (2) on node 1 (default targets). 
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [D:\Jenkins\workspace\hcg\database.solution\database.solution\database.solution.sqlproj] 
GenerateSqlTargetFrameworkMoniker: 
Skipping target "GenerateSqlTargetFrameworkMoniker" because all output files are up-to-date with respect to the input files. 
CoreCompile: 
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:x64 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll /debug+ /debug:full /optimize- /out:obj\Debug\database.solution.dll /subsystemversion:6.00 /target:library /warnaserror- /utf8output "C:\Users\svc_jenkins\AppData\Local\Temp\.NETFramework,Version=v4.5.2.SqlClrAttributes.cs" 
D:\Nuget\Microsoft.Data.Tools.Msbuild\lib\net40\Microsoft.Data.Tools.Schema.SqlTasks.targets(477,5): error MSB4062: The "SqlModelResolutionTask" task could not be loaded from the assembly D:\Nuget\Microsoft.Data.Tools.Msbuild\lib\net40\Microsoft.Data.Tools.Schema.Tasks.Sql.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 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. [D:\Jenkins\workspace\hcg\database.solution\database.solution\database.solution.sqlproj] 
Done Building Project "D:\Jenkins\workspace\hcg\database.solution\database.solution\database.solution.sqlproj" (default targets) -- FAILED. 
Done Building Project "D:\Jenkins\workspace\hcg\database.solution\database.solution.sln" (default targets) -- FAILED. 

Build FAILED. 

"D:\Jenkins\workspace\hcg\database.solution\database.solution.sln" (default target) (1) -> 
"D:\Jenkins\workspace\hcg\database.solution\database.solution\database.solution.sqlproj" (default target) (2) -> 
(GetReferenceAssemblyPaths target) -> 
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [D:\Jenkins\workspace\hcg\database.solution\database.solution\database.solution.sqlproj] 


"D:\Jenkins\workspace\hcg\database.solution\database.solution.sln" (default target) (1) -> 
"D:\Jenkins\workspace\hcg\database.solution\database.solution\database.solution.sqlproj" (default target) (2) -> 
(_SetupSqlBuildInputs target) -> 
    D:\Nuget\Microsoft.Data.Tools.Msbuild\lib\net40\Microsoft.Data.Tools.Schema.SqlTasks.targets(477,5): error MSB4062: The "SqlModelResolutionTask" task could not be loaded from the assembly D:\Nuget\Microsoft.Data.Tools.Msbuild\lib\net40\Microsoft.Data.Tools.Schema.Tasks.Sql.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 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. [D:\Jenkins\workspace\hcg\database.solution\database.solution\database.solution.sqlproj] 

    1 Warning(s) 
    1 Error(s) 

Time Elapsed 00:00:00.51 

答えて

1

SSDT NuGetパッケージは、MSBuildのバージョン14.0アップデート3以降(すなわち15.0 RC)を見込んでいます。それはここから入手可能です:https://www.microsoft.com/en-us/download/details.aspx?id=48159

あなたはまた、NuGetパッケージの場所を参照するように、いくつかの環境変数を設定する必要がありますので、同じよう: setx SQLDBExtensionsRefPath C:\agent\Microsoft.Data.Tools.Msbuild\lib\net40 /M setx SSDTPath C:\agent\Microsoft.Data.Tools.Msbuild\lib\net40 /M

参考リンク: https://blogs.msdn.microsoft.com/ssdt/2016/08/22/releasing-ssdt-with-visual-studio-15-preview-4-and-introducing-ssdt-msbuild-nuget-package/

+0

おかげで、MSBuildTools2015をインストールし、MSBuildのを参照しますその道でそれを解決しました。 –

関連する問題