0

CIにも使用したいテストサーバーを入手しました。

計画は、gitリポジトリをリッスンするHudsonをセットアップし、新しいコミットで変更をフェッチし、ソリューションを構築し、テストを実行し(出力を取得)、すべてが緑色に見えてChuckNorrisを表示する場合はテスト環境のWebアプリケーションをセットアップします。

私は最初の部分(gitポートはatmで閉じられていますが、それはこの質問のポイントではありません)と最後の部分で苦労しています。

アプリケーション自体は、.Net 4.0、Asp.Net Mvc 2 RTM、および多数のサードパーティツールを使用して構築されています。

最初は、何も構築できませんでしたが、.Net4.0SDKキットをダウンロードして役に立ちました。次に、-Webプロジェクトをビルドできませんでした-C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\フォルダの内容を開発ワークステーションからサーバーにコピーしただけです。次に、asp.net mvc2 rtm自体をインストールする必要があり、ソリューションは最終的に正常に構築されました。

問題は、ここから取得したalbacoreビルドスクリプトの最後のステップにあります。

出力は次のとおりです。

C:\ temp \ buildtest> rake -f build.rb(C:/ temp / buildtest内)Microsoft(R)BuildEngineバージョン4.0.30319.1[Microsoft .NET Framework、バージョン4.0.30319.1] Copyright(C)Microsoft Corporation 2007 。 全著作権所有。

ドメイン->C:\ temp \ buildtest \ src \ Domain \ bin \ Release \ Domain.dll Infra-
> C:\ temp \ buildtest \ src \ Infrastructure \ bin \ Release \Infra.dll
永続性->C:\ temp \ buildtest \ src \ Persistence \ bin \ Release \ Persistence.dll
App-> C:\ temp \ buildtest \ src \ App \ bin \ Release \ App.dll
Web-> C:\ temp \ buildtest \ src \ Web \ bin \ Release \ Web.dll UI-
> C:\ temp \ buildtest \ src \ UI \ bin \UI.dll
ユニット->C:\ temp \ buildtest \ src \ UnitTests \ bin \ Release \Unit.dll
統合->C: \ temp \ buildtest \ src \ Integration \ bin \ Release \ Integration.dll
xUnit.netコンソールテストランナー(32ビット.NET 4.0.30319.1)
Copyright(C)2007-10MicrosoftCorporation。

xunit.dll:バージョン1.6.1.1521
テストアセンブリ:C:\ temp \ buildtest \ src \ UnitTests \ bin \ Release \ src \ UnitTests \ bin \ Release \ Unit.dll

合計84、失敗0、スキップ0、9.560秒かかりました
xUnit.netコンソールテストランナー(32ビット.NET 4.0.30319.1)
Copyright(C)2007-10MicrosoftCorporation。

xunit.dll:バージョン1.6.1.1521
テストアセンブリ:C:\ temp \ buildtest \ src \ Integration \ bin \ Release \ src \ Integration \ bin \ Release \ Integration.dll

合計27、失敗0、スキップ0、34.472秒かかりました

未処理の例外:System.TypeInitializationException:'Microsoft.Build.CommandLine.MSBuildApp'のタイプ初期化子が例外をスローしました。---> System.IO.Fi leNotFoundException:ファイルまたはアセンブリ'Microsoft.Build.Engine、Ve rsion = 3.5.0.0、Culture = neutral、PublicKeyToken=b03f5f7f11d50a3a'またはその依存関係の1つを読み込めませんでした。システムは、指定されたファイルを見つけることができません。ファイル名:'Microsoft.Build.CommandLine.MSBuildApp..cctor()の' Microsoft.Build.Engine、Version = 3.5.0.0、Culture = neutral、PublicKeyT oken = b03f5f7f11d50a3a'

WRN:アセンブリバインディングログがオフになっています。アセンブリバインドの失敗のログを有効にするには、レジストリ値[HKLM \ Software \ Microsoft \ Fusion!EnableLog](DWORD)を1に設定します。注:アセンブリのバインドの失敗のログには、パフォーマンスの低下が伴います。この機能をオフにするには、レジストリ値[HKLM \ Software \ Microsoft \ Fusion!EnableLog]を削除します。

---内部例外スタックトレースの終了---Microsoft.Build.CommandLine.MSBuildApp.Main()F、[2010-09-18T00:35:07.728632#2072]致命的-:MSBuildが失敗しました。ビルドログFまたは詳細レーキが中止されましたを参照してください。MSBuildが失敗しました。詳細については、ビルドログを参照してくださいC:/Ruby191/lib/ruby/gems/1.9.1/gems/albacore-0.1.5/lib/albacore/msbuild.rb:41:in `build_solution'( - 痕跡)

C:\ temp \ buildtest>

これは私のalbacoreスクリプトがどのように見えるかです:

require 'rubygems'
require 'albacore'
task :default => :publish

desc "Builds Interreg solution"
msbuild :build do |m|
  m.path_to_command = File.join(ENV["windir"], 
    "Microsoft.NET", "Framework", "v4.0.30319", "MSBuild.exe")
  m.properties :configuration => :Release
  m.targets :Clean, :Build
  m.solution = "Interreg.sln"
  m.verbosity = "minimal"
end

desc "Runs some tests"
xunit :tests => :build do |x|
  x.path_to_command = "lib/xunitnet/xunit.console.clr4.x86.exe"
  x.assemblies "src/UnitTests/bin/Release/Unit.dll",
    "src/Integration/bin/Release/Integration.dll"
  x.html_output = "doc"
end

desc "Publishes web application"
msbuild :publish=>:tests do |m|
  m.properties={:configuration=>:Release}
  m.targets [:ResolveReferences, :_CopyWebApplication]
  m.properties={
   :webprojectoutputdire=>"c:/temp/outputdir/",
   :outdir=>"c:/temp/outputdir/bin/"
  }
  m.solution="src/UI/UI.csproj"
end

だから...何が欠けているのですか?それを機能させる方法は?

VisualStudioなしでasp.netWebアプリケーションをパッケージ化する方法は?

4

1 に答える 1

1

CIサーバーにWindows7SDKをインストールします。これには、CIサーバーで.NET4アプリケーションを構築するために必要なすべてのものが含まれています。これにより、GACで必要なすべての依存関係が処理され、開発ワークステーションから大量のファイルを手動でコピーする必要がなくなります。

http://msdn.microsoft.com/en-us/windows/bb980924.aspx

于 2010-09-18T15:24:48.900 に答える