I created a solution from the Blazor WebAssembly template where I checked off the ASP.NET Core hosted checkbox, so I have Client, Server, Shared projects in the solution.
To this solution I added a Razor class library (without checking "Support pages and views") called BlogsRcl in which I have a Blazor component called Blogs.razor.
I want to be able to inject an HttpClient into my Blogs.razor component just like the FetchData.razor component in the 'Client` project has, i.e. '@inject HttpClient Http'.
In the '.csproj' file for my BlogsRcl project I added either/or/both references to
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0.0" />
<PackageReference Include="System.Net.Http" Version="5.0.0" />
which, everything's kosher with Microsoft.Extensions.Http, but when I add System.Net.Http, every project in the solution complains that it is Unable to find package System.Net.Http with version (>= 5.0.0).
Yet when I do a Go To Definition on the HttpClient in the FetchData.razor component in the Client project, the metadata says Assembly System.Net.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Edit: I tried adding <PackageReference Include="System.Net.Http.Json" Version="5.0.0" /> too, to no avail.
What am I missing?