TLDR; Visual Studio 2019 may simply need a restart.
I encountered this situation using projects based on Microsoft.NET.Sdk project.
<Project Sdk="Microsoft.NET.Sdk">
Specifically:
Project1
: targets .netstandard2.1
Microsoft.Extensions.Logging.Console
via NugetProject2
: targets .netstandard2.1
Project1
via a Project referenceProject2Tests
: targets .netcoreapp3.1
Project2
via a Project referenceAt test execution, I received the error messaging indicating that Microsoft.Extensions.Logging.Console
could not be found, and it was indeed not in the output directory.
I decided to work around the issue by adding Microsoft.Extensions.Logging.Console
to Project2
, only to discover that Visual Studio's Nuget Manager did not list Microsoft.Extensions.Logging.Console
as installed in Project1
, despite it's presence in the Project1.csproj
file.
A simple shut down and restart of Visual Studio resolved the problem without the need to add an extra reference. Perhaps this will save someone 45 minutes of lost productivity :-)