Visual Studio 当项目的OutputPath更改时,MSTest不执行单元测试

mcvgt66p  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(121)

当我为我的单元测试项目更改OutputPath时,测试仍然可以在Test Explorer中运行,但是当我尝试运行它们(右键单击->运行)时,它们不运行,并且我在输出窗口中得到下面的错误。为什么它突然找不到那个dll?

Building Test Projects
Starting test discovery for requested test run
========== Starting test discovery ==========
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args)
. Please check the diagnostic logs for more information.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.ThrowOnTestHostExited(Boolean testHostExited)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
========== Test discovery aborted: 0 Tests found in 859.1 ms ==========
========== Starting test run ==========
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in < 1 ms ==========

字符串
OutputPath位置中的bin文件夹似乎包含了项目文件夹中bin文件夹中的所有文件,如果我没有更改OutputPath的话。
我使用Visual Studio 2022中的MStest。
我错过了什么?
x1c 0d1x的数据

相关问题