15

自動ビルド プロセスを実装しようとしています。ビルド後、nunit-console.exe の単体テストが実行されます。次のエラーが表示されます。

> c:\nunit_2.5.10\nunit-console.exe c:\builds\Output\bin\TDD.nunit /framework=4.0.30319 /nologo /trace=Off
ProcessModel: Default    DomainUsage: Default
Execution Runtime: v4.0.30319
Unhandled Exception:
System.ArgumentException: NUnit components for version 4.0.30319 of the CLR are not installed
Parameter name: targetRuntime
   at NUnit.Util.TestAgency.LaunchAgentProcess(RuntimeFramework targetRuntime, Boolean enableDebug)
   at NUnit.Util.TestAgency.CreateRemoteAgent(RuntimeFramework framework, Int32 waitTime, Boolean enableDebug)
   at NUnit.Util.TestAgency.GetAgent(RuntimeFramework framework, Int32 waitTime, Boolean enableDebug)
   at NUnit.Util.ProcessRunner.Load(TestPackage package)
   at NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)
   at NUnit.ConsoleRunner.Runner.Main(String[] args)

ビルド マシンに nunit-agent.exe はありません。ただし、私のマシンでは呼び出されないので、必要ないと思います。

nunit-agent.exe が必要な場合があるのに、必ずしも必要ではないのはなぜですか? nunit-agent を起動する必要がないようにするには、どのような条件を満たす必要がありますか?

編集:私は、それがどのように機能するかを説明しているリソースを1つ見つけましたが、あまりよくありません: http://www.nunit.org/index.php?p=nunit-agent&r=2.5.10。NUnit で使用されているフレームワークとは異なるフレームワークでプログラムを実行する必要がある場合に起動されると書かれています (NUnit は 2.0 用にコンパイルされているため、これが当てはまります)。ただし、私のマシンでは、条件は同じように見えますが、nunit-agent.exe は実行されません。

4

3 に答える 3

2

「startup/supportedRuntime」構成タグを追加してnunit-console.exe.config解決しました。

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0.30319" />
</startup>
于 2016-03-20T22:10:32.013 に答える
0

Fusion を使用して、欠落している可能性のあるアセンブリと、.exe が探している場所を確認してください。 http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

于 2013-07-09T22:36:24.063 に答える