[英]Running Unit Tests fails with VS2017 (vstest.console.exe) because the Windows OS is different
I'm trying to run some unit tests from the command line using Visual Studio 2017 and the vstest.console.exe (C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe), The execution completes successfully on Windows 10 OS but it fails on Windows Server 2016 OS . 我正在尝试使用Visual Studio 2017和vstest.console.exe从命令行运行一些单元测试(C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ Enterprise \\ Common7 \\ IDE \\ CommonExtensions \\ Microsoft \\ TestWindow \\ vstest.console.exe),执行在Windows 10操作系统上成功完成,但在Windows Server 2016操作系统上失败。 Any idea what I could be missing here. 知道我在这里可能会缺少什么。 I'm guessing it's a simple environment variable that is not being set and I'm unable to nail down the same. 我猜这是一个未设置的简单环境变量,我无法确定该变量。 Any help, pointers, support is greatly appreciated from all the experienced VS users out there! 所有经验丰富的VS用户将非常感谢您提供的任何帮助,指示和支持! Thanks! 谢谢!
The error that I notice is 我注意到的错误是
Error Message:
Failed to set up the execution context to run the test
The machines required the installation of an additional package in VS 2017 for the execution of Unit Tests. 这些机器需要在VS 2017中安装其他软件包才能执行单元测试。 These packages were installed by default with the installation of the .Net Desktop environment earlier but with the latest versions of VS 2017 looks like the auto installation of these packages has been disabled and you need to install them explicitly as additional components. 默认情况下,这些软件包是在.Net Desktop环境的早期版本中默认安装的,但是在VS 2017的最新版本中,这些软件包的自动安装似乎已被禁用,您需要将它们作为其他组件进行显式安装。
Packages required for Unit Tests to work: 单元测试正常运行所需的软件包:
Under Compilers, build tools, and runtimes
Visual C++ 2017 Redistributable Update
VC++ 2017 version 15.8 v14.15 latest v141 tools
VC++ 2017 version 15.7 v14.14 toolset
After the installation of the above packages Unit Tests can execute successfully! 安装上述软件包后,单元测试可以成功执行!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.