gpt4 book ai didi

.net - 单元测试项目找不到被测程序集(或依赖项)

转载 作者:行者123 更新时间:2023-12-04 00:45:07 24 4
gpt4 key购买 nike

当我尝试运行我的单元测试项目时,出现以下错误:

Could not load file or assembly 'ASSEMBLY_NAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

The system cannot find the file specified.


被测程序集位于同一个解决方案中,并且每个项目都以 .NET 4.0 框架为目标。
它工作了一段时间,但今天我又遇到了这个错误。
我无法弄清楚出了什么问题,因为错误消息并没有告诉我足够的信息。 (例如;找不到哪个文件..)
我试图添加一个新的测试项目,但在它给我同样的错误消息之前,它工作了一段时间。
有没有人可以指出我正确的方向?
编辑:在诊断构建日志中,出现以下错误:
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\TeamTest\
Microsoft.TeamTest.targets(14,5):
error : Could not load file or assembly 'ASSEMBLY_NAME, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The system cannot find the file specified.

Done executing task "BuildShadowTask" -- FAILED. (TaskId:671)

Done building target "ResolveTestReferences" in
project "ASSEMBLY_NAME.Tests.vbproj" -- FAILED.: (TargetId:985)

最佳答案

查询 Build->Configuration Manager...菜单。所有项目应该有相同的平台和专栏Build检查。

您也可以查看构建的输出(Output 窗口),它通常会更清楚地说明找不到哪个文件。

关于.net - 单元测试项目找不到被测程序集(或依赖项),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7993469/

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