Repository navigation
Description
Describe the bug
dotnet test fails with the following error after upgrading to the .NET 8 SDK:
An assembly specified in the application dependencies manifest (testhost.deps.json) was not found:
package: 'NuGet.Frameworks', version: '6.5.0'
path: 'lib/netstandard2.0/NuGet.Frameworks.dll'
. Please check the diagnostic logs for more information.
To Reproduce
git clone https://devdiv@dev.azure.com/devdiv/DevDiv/_git/VS.CloudCache
cd VS.CloudCache
git checkout f89f466
cd test\Microsoft.VisualStudio.Cache.Tests
dotnet test
It works.
Now change global.json at the repo root to consume 8.0.100 of the .NET SDK:
- "version": "7.0.302",
+ "version": "8.0.100",Run dotnet test again, and it'll fail:
Determining projects to restore...
Restored C:\Users\andarno\source\repos\VS.CloudCache\src\Microsoft.VisualStudio.Cache\Microsoft.VisualStudio.Cache.csproj (in 2.25 sec).
Restored C:\Users\andarno\source\repos\VS.CloudCache\test\Microsoft.VisualStudio.Cache.Tests\Microsoft.VisualStudio.Cache.Tests.csproj (in 4.23 sec).
Microsoft.VisualStudio.Cache -> C:\Users\andarno\source\repos\VS.CloudCache\bin\Microsoft.VisualStudio.Cache\Debug\net6.0-windows10.0.19041\Microsoft.VisualStudio.Cache.dll
Microsoft.VisualStudio.Cache.Tests -> C:\Users\andarno\source\repos\VS.CloudCache\bin\Microsoft.VisualStudio.Cache.Tests\x64\Debug\net6.0-windows10.0.19041\win-x64\Microsoft.VisualStudio.Cache.Tests.dll
Test run for C:\Users\andarno\source\repos\VS.CloudCache\bin\Microsoft.VisualStudio.Cache.Tests\x64\Debug\net6.0-windows10.0.19041\win-x64\Microsoft.VisualStudio.Cache.Tests.dll (.NETCoreApp,Version=v6.0)
Microsoft (R) Test Execution Command Line Tool Version 17.8.0 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Testhost process for source(s) 'C:\Users\andarno\source\repos\VS.CloudCache\bin\Microsoft.VisualStudio.Cache.Tests\x64\Debug\net6.0-windows10.0.19041\win-x64\Microsoft.VisualStudio.Cache.Tests.dll' exited with error: Error:
An assembly specified in the application dependencies manifest (testhost.deps.json) was not found:
package: 'NuGet.Frameworks', version: '6.5.0'
path: 'lib/netstandard2.0/NuGet.Frameworks.dll'
. Please check the diagnostic logs for more information.
Test Run Aborted.
Build FAILED.
0 Warning(s)
0 Error(s)
I have no idea why it would fail like this, considering this test has no NuGet.Frameworks dependency at all. And I can't find a testhost.deps.json file in the output directory either.
dotnet --info output in details:
Details
dotnet --info .NET SDK: Version: 8.0.101 Commit: 6eceda187b Workload version: 8.0.100-manifests.077a4f18Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.101\
.NET workloads installed:
Workload version: 8.0.100-manifests.077a4f18
[aspire]
Installation Source: VS 17.10.34601.30, VS 17.10.34531.228
Manifest Version: 8.0.0-preview.1.23557.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.0-preview.1.23557.2\WorkloadManifest.json
Install Type: Msi
Host:
Version: 8.0.1
Architecture: x64
Commit: bf5e279d92
.NET SDKs installed:
6.0.418 [C:\Program Files\dotnet\sdk]
7.0.115 [C:\Program Files\dotnet\sdk]
7.0.203 [C:\Program Files\dotnet\sdk]
7.0.312 [C:\Program Files\dotnet\sdk]
7.0.405 [C:\Program Files\dotnet\sdk]
8.0.101 [C:\Program Files\dotnet\sdk]
8.0.200-preview.24060.48 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
C:\Users\andarno\source\repos\VS.CloudCache\global.json
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Activity
vitek-karas commentedon Feb 2, 2024
@nohwnd Could you please redirect as appropriate?
nohwnd commentedon Feb 2, 2024
Nuget.Frameworks is a dependency of testhost. But your project is not referencing Microsoft.NET.SDK so it falls back to using testhost that we ship in dotnet folder.
exec --runtimeconfig "S:\c\VS.CloudCache\bin\Microsoft.VisualStudio.Cache.Tests\x64\Debug\net6.0-windows10.0.19041\win-x64\Microsoft.VisualStudio.Cache.Tests.runtimeconfig.json" --depsfile "S:\c\VS.CloudCache\bin\Microsoft.VisualStudio.Cache.Tests\x64\Debug\net6.0-windows10.0.19041\win-x64\Microsoft.VisualStudio.Cache.Tests.deps.json" --additional-deps "C:\Program Files\dotnet\sdk\8.0.101\testhost.deps.json" --additionalprobingpath "C:\Program Files\dotnet\sdk\8.0.101" "C:\Program Files\dotnet\sdk\8.0.101\testhost.dll" --port 18553 --endpoint 127.0.0.1:018553 --role client --parentprocessid 51516 --diag "S:\c\VS.CloudCache\test\Microsoft.VisualStudio.Cache.Tests\logs\dotnet_51516.host.24-02-02_13-07-20_60928_5.diag" --tracelevel 4 --telemetryoptedin false'
dotnet sdk is replacing our version of nuget.frameworks so I guess this fallback is broken again. Posted a PR to the repo, so it does not hit this fallback.
https://dev.azure.com/devdiv/DevDiv/_git/VS.CloudCache/pullrequest/526038
nohwnd commentedon Feb 2, 2024
Will fix on vstest microsoft/vstest#4875 . And probably add test in here.
Closing because projects should reference Microsoft.NET.Test.SDK if possible. Which this project can and it fixes it.
AArnott commentedon Feb 2, 2024
Thanks, @nohwnd!
robertmclaws commentedon Mar 27, 2024
Referencing the Microsoft.NET.Test.Sdk NuGet package did NOT fix this issue for
dotnet testcommands. They are still failing in build environments.Still experiencing the issue on .NET 8.0.203 when referencing the following packages in test projects:
PauloJoseBR commentedon Apr 9, 2024
I got the same problem @robertmclaws. Have you found a solution?
duongphuhiep commentedon Apr 10, 2024
up vote
nohwnd commentedon Apr 10, 2024
The technical issue was the same for Robert. He had a project that was marked as a test project, but it didn’t have the Microsoft.NET.Test.SDK installed.
In their case they set true build property on their utility project. This property tells vstest to run tests from it.
Solution for them was to not set that property.
update packages
LeonardoDaLuz commentedon Jan 13, 2025
Delete the virus comment above.
bugfix: Fixed an issue where tests would fail to run due to Newtonsof…
Mertsch commentedon Feb 16, 2026
If you come here with
This happens when you try to run MTP tests with VSTest.
In Azure DevOps, use