gpt4 book ai didi

visual-studio-2017 - 编码的 UI 抛出 "Unable to load one or more of the requested types"

转载 作者:行者123 更新时间:2023-12-04 20:30:24 29 4
gpt4 key购买 nike

我无法使编码的 UI 调试工作。 Visual Studio 不会在断点处停止。一个简单的演示测试(仅在 Excel 工作表单元格中输入一个数字)在没有调试的情况下运行时成功。但是在调试测试时,测试运行器会立即出错,而不会尝试进入测试类构造函数(如果提供)或测试方法。

报告的错误是:

Message: Unit Test Adapter threw exception: 
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..

我正在运行 Visual Studio 2017,版本 15.5.0。

调试窗口的输出:
'testhost.x86.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Cannot find or open the PDB file.
'testhost.x86.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\TESTPLATFORM\testhost.x86.exe'. Cannot find or open the PDB file.
'testhost.x86.exe' (CLR v4.0.30319: testhost.x86.exe): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\TESTPLATFORM\Microsoft.TestPlatform.CoreUtilities.dll'. Cannot find or open the PDB file.
'testhost.x86.exe' (CLR v4.0.30319: testhost.x86.exe): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\TESTPLATFORM\Microsoft.TestPlatform.PlatformAbstractions.dll'. Cannot find or open the PDB file.
'testhost.x86.exe' (CLR v4.0.30319: testhost.x86.exe): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\TESTPLATFORM\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll'. Cannot find or open the PDB file.
'testhost.x86.exe' (CLR v4.0.30319: testhost.x86.exe): Loaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\TESTPLATFORM\Microsoft.TestPlatform.CrossPlatEngine.dll'. Cannot find or open the PDB file.

...

'QTAgent32_40.exe' (CLR v4.0.30319: TestAppDomain: 0bb1983f-0f53-41cc-b4ed-143874102a64): Unloaded 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\TESTPLATFORM\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel.dll'
'QTAgent32_40.exe' (CLR v4.0.30319: TestAppDomain: 0bb1983f-0f53-41cc-b4ed-143874102a64): Unloaded 'C:\VST\CodedUITestProject2\TestResults\abcdef_X#XXX## 2017-12-05 11_05_06\Out\CodedUITestProject2.dll'
The thread 0x1860 has exited with code 0 (0x0).
The thread 0x1dcc has exited with code 0 (0x0).
Exception thrown: 'System.Threading.ThreadInterruptedException' in mscorlib.dll
The thread 0x1cb0 has exited with code 0 (0x0).
The thread 0x2d54 has exited with code 0 (0x0).
The thread 0x2a40 has exited with code 0 (0x0).
The thread 0x1e04 has exited with code 0 (0x0).
The program '[8104] QTAgent32_40.exe: Program Trace' has exited with code 0 (0x0).
The thread 0x1714 has exited with code 0 (0x0).
The thread 0x265c has exited with code 0 (0x0).
The program '[8104] QTAgent32_40.exe' has exited with code 0 (0x0).
The thread 0x2d9c has exited with code 0 (0x0).
The thread 0xde4 has exited with code 0 (0x0).
The thread 0x3bc has exited with code 0 (0x0).
The thread 0x253c has exited with code 0 (0x0).
The program '[12012] testhost.x86.exe: Program Trace' has exited with code 0 (0x0).
The program '[12012] testhost.x86.exe' has exited with code 0 (0x0).

我试过重新安装 Visual Studio 并安装最新的位等,但无济于事。我在两台不同的机器上遇到了这个问题。

最佳答案

我用的是最新的VS2017 15.5,确实有这个问题:

enter image description here

但在其他 VS 版本或 VS 2017 15.4.4 中,确实没有这个问题。

由于我可以重现此问题,因此我会在此处帮助您将此反馈报告给产品团队:

https://developercommunity.visualstudio.com/content/problem/161803/cant-debug-coded-ui-test-in-latest-vs2017.html

如果可能,您可以添加您的评论并对此反馈进行投票。

更新:

我将我的 VS2017 更新到 15.5.1 版本,然后像下面的屏幕截图一样设置系统环境变量,注意:你的 VS2017 将安装到 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise 这样的路径\Common7\IDE。然后我重新启动VS IDE并重新打开测试项目,我现在可以很好地调试它了。

由于最新的 VS 版本是 15.5.2,也请更新到最新版本。

enter image description here

关于visual-studio-2017 - 编码的 UI 抛出 "Unable to load one or more of the requested types",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47661228/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com