3

自動テストプロジェクトをC#ソリューションに追加し、ビルドサーバーにチェックインしました。

ビルドスクリプトをMSBuild(.NET Framework 3.5)を使用して実行すると、いくつかのエラー(次のような)が発生します。

**cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

**.cs(21,17): error CS0246: The type or namespace name 'TestContext' could not be found (are you missing a using directive or an assembly reference?)

**.cs(73,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?)

**.cs(73,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)

**.cs(14,6): error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?)

**.cs(14,6): error CS0246: The type or namespace name 'TestClassAttribute' could not be found (are you missing a using directive or an assembly reference?)

コンピューターで.NET3.5msbuildを実行すると、正しくビルドされます。

ビルドサーバーには.NET4.0が搭載されておらず、ステップアップすることはできません。違いを引き起こしている可能性のあるものと、テストプロジェクトの構築を成功させるために私ができることを誰かが提案できますか?

ありがとう

4

1 に答える 1

2

前述のとおり、最も簡単な方法は、適切なバージョンの Visual Studio をビルド サーバーにインストールして、すべての MSTest 依存関係を取得することです。これは通常行われることです。

何らかの理由でそれができない場合は、次のページに、VS2008 をインストールせずに依存関係を利用できるようにする方法を示します。

http://www.shunra.com/shunrablog/index.php/2009/04/23/running-mstest-without-visual-studio/

于 2012-05-26T19:53:37.727 に答える