c# nuget 包没有出现在 VS 的引用中

c# nuget package doesn't show up in references in VS

我想创建一个使用 powershell 执行操作的 C# 应用程序。我在互联网上找到了很多解决方法 like this. The most answeres to this use the Powershell class from 'Microsoft.WSMan.Runtime'。现在,当我在 nuget 中搜索这个包并安装它时,它没有出现在 visual studio 的引用列表中,而且 PowerShell 对象上的 using 语句或 'quick fix' 也没有找到它。

我是不是安装错了,还是我还需要其他东西?


编辑以获取更多信息:

我在包目标 .net core 3.1 而不是 .net framework 4.6.1 中找到了程序集。所以你在解决方案资源管理器中看不到引用。

包作者的设计,你可以download the package manually,将名称xx.nupkg重命名为xx.zip查看内容包裹。

包结构:

以及Microsoft.WSMan.Runtime.nuspec文件的内容:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
  <metadata>
    ...
    <dependencies>
      <group targetFramework=".NETCoreApp3.1" />
    </dependencies>
    <contentFiles>
      <files include="**/*" buildAction="None" copyToOutput="true" flatten="false" />
    </contentFiles>
  </metadata>
</package>