【问题标题】:dotnet restore not copying NETStandard.Library and other framework packagesdotnet restore 不复制 NETStandard.Library 和其他框架包
【发布时间】:2021-02-21 05:33:18
【问题描述】:

我有一台不允许连接到任何网络的 PC。我需要在这台 PC 上进行网络标准项目。我之前在这种情况下使用过 Net Framework 项目,只是使用 nuget.exe 选项将包保存到文件夹,将文件夹复制到隔离的 PC 并使用 nuget 从该文件夹恢复包。

但是使用 dotnet restore 机制对 Net Standard 项目执行此操作失败,因为缺少 NETStandard.Library 等包。

我用来创建离线包文件夹的命令是:

dotnet restore solution.sln --packages offline_cache

将文件夹复制到我使用的隔离机器后:

dotnet restore solution.sln --source offline_cache

【问题讨论】:

    标签: c# .net .net-core nuget .net-standard


    【解决方案1】:

    听起来你想跑步dotnet publishhttps://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish

    请注意,如果您使用的是 PackageReferences,那么 nuget restore 只会将依赖项安装在您的全局缓存中,而不是将它们复制到本地 https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多