所有测试都没有定论,而没有找到应用程序依赖项中指定的组件。迁移到.NET 6时错误
我正在从.NET 5迁移,所有测试都在工作,并成功完成,直到我将所有.CSPROJ文件更新为.NET 6.0这样:
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
之后所有集成和单元测试在骑手中显示为不确定的,并带有以下错误:
Test not run
Last runner error: Test runner agent exited unexpectedly Process /usr/share/dotnet/dotnet:138437 exited with code '140': Error: An assembly specified in the application dependencies manifest (Logging.UnitTests.deps.json) was not found: package: 'Autofac', version: '6.4.0' path: 'lib/net6.0/Autofac.dll'
--- EXCEPTION #1/3 [UnknownExitCodeException]
Message = “
Process /usr/share/dotnet/dotnet:138437 exited with code '140':
Error:
An assembly specified in the application dependencies manifest (Logging.UnitTests.deps.json) was not found:
package: 'Autofac', version: '6.4.0'
path: 'lib/net6.0/Autofac.dll'
”
我有尝试将所有Nuget软件包(包括AUTOFAC)更新为最新版本,尝试与AutoFac进行所有可能的组合,但仍然存在错误。我在Arch Linux上,拥有所有正确的dotnet SDK和Runtimes。
dotnet --list-sdks
5.0.407 [/usr/share/dotnet/sdk]
6.0.102 [/usr/share/dotnet/sdk]
6.0.301 [/usr/share/dotnet/sdk]
dotnet --list-runtimes
Microsoft.AspNetCore.App 5.0.16 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.16 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
该应用程序在运行和调试模式下正常运行,只是所有测试都停止工作。这也发生在GitHub管道中,有什么想法吗?
非常感谢您!
I'm migrating from .NET 5 and all tests are working, and finishing succesfully, until I update all .csproj files to .NET 6.0 like this:
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
Afterwards all integration and unit tests show as inconclusive in Rider with the following error:
Test not run
Last runner error: Test runner agent exited unexpectedly Process /usr/share/dotnet/dotnet:138437 exited with code '140': Error: An assembly specified in the application dependencies manifest (Logging.UnitTests.deps.json) was not found: package: 'Autofac', version: '6.4.0' path: 'lib/net6.0/Autofac.dll'
--- EXCEPTION #1/3 [UnknownExitCodeException]
Message = “
Process /usr/share/dotnet/dotnet:138437 exited with code '140':
Error:
An assembly specified in the application dependencies manifest (Logging.UnitTests.deps.json) was not found:
package: 'Autofac', version: '6.4.0'
path: 'lib/net6.0/Autofac.dll'
”
I have tried updating all nuget packages, including autofac, to the latest version, tried all possible combinations with Autofac, but the error still remains. I'm on Arch linux and have all the correct dotnet sdks and runtimes.
dotnet --list-sdks
5.0.407 [/usr/share/dotnet/sdk]
6.0.102 [/usr/share/dotnet/sdk]
6.0.301 [/usr/share/dotnet/sdk]
dotnet --list-runtimes
Microsoft.AspNetCore.App 5.0.16 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.16 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
The application runs normally in both Run and Debug mode, it's just that all tests have stopped working. This also happens in the GitHub pipeline, any ideas?
Thank you very much in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,经过数小时的修复,我尝试了以下操作:
tl; dr,将以下内容添加到您拥有的每个测试项目中:
So after many hours finding a fix I tried the following:
TL;DR, add the following to every test project you have: