Jenkinsコンパイルasp.Netよくある質問

1972 ワード

Jenkinsは広く使われているようで、多くの会社が使っています.ここでは最近新しいノードにAspを配置しています.Netサイトで発生した問題:
まず環境について言えばjenkinsのほかにNet 2.0 4.0などはあなたのプロジェクトに従って来て、私のここは4.0で、それから1つのMS SDKをインストールすることを提案して、多くのものはすべて詰めることができて、もし詰めていないならば、以下の間違いが現れるかもしれません:
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

 
error MSB3091: Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A. You may be able to solve the problem by doing one of the following:  1) Install the Microsoft Windows SDK.  2) Install Visual Studio 2010.  3) Manually set the above registry key to the correct location.  4) Pass the correct location into the "ToolPath" parameter of the task. [

 
環境構成の違いによりファイルが見つかりません:
(GetAspNetMergePath target) -> 
  C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(132,5): error : Can't find the valid AspnetMergePath

解決策はjenkinsがマシンに配備する実際のパスを見つけることです.例えば、私は次のようにします.
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools
 
このパスをJenkinsのコンパイル命令に置けばいいです.例えば、私の:
/t:Rebuild /property:Configuration=Release;PublishProfile=jenkins-DB2Eshang;DeployOnBuild=true;VisualStudioVersion=12.0 /property:TargetFrameworkVersion=v4.5 /p:AspnetMergePath="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools