我在从命令行运行测试时遇到了一些麻烦。我有一个单独的测试项目,通常使用Rider,测试运行完美无缺。但是,我想在CI环境中运行它们,因此需要能够从命令行运行它们。
我试图跑步 项目名称>" C:\ Program Files(x86)\ NUnit.org \ nunit-console \ nunit3-console.exe"测试\ Test.csproj NUnit Console Runner 3.4.0 版权所有(C)2016 Charlie Poole
Runtime Environment
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Version: 4.0.30319.42000
Test Files
Test\Test.csproj
Errors and Failures
1) Error : Test.MVCmodel.CoilClassTest.CoilCreateEmptyIdTest
System.BadImageFormatException : Could not load file or assembly 'UserInterface, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at Test.MVCmodel.CoilClassTest.CoilCreateEmptyIdTest()
跑步时也会发生同样的事情 " C:\ Program Files(x86)\ NUnit.org \ nunit-console \ nunit3-console.exe"测试\ BIN \调试\ Test.dll的
测试项目位于MainProject内:Projectname \ Projectname.csproj和Projectname \ Test \ Test.csproj
是的,我在Stackoverflow上发现了很多相似的帖子,但我找不到适用的解决方案。