【问题标题】:Can I add into my nuget nupkg my library that has a version of .net core and .net46?我可以将具有 .net core 和 .net46 版本的库添加到我的 nuget nupkg 中吗?
【发布时间】:2016-09-06 03:22:39
【问题描述】:

我可以将具有 .net core 和 .net40、.net45 版本的库添加到我的 nuget nupkg 中吗?我知道如何打包.net40、.net45,但我可以看到有一个命令让.net core 打包它们dotnet pack。有人可以澄清一下吗?

非常感谢!

【问题讨论】:

    标签: .net nuget .net-core


    【解决方案1】:

    其实很简单。您可以在同一文件夹下准备 .nuspec 文件和 lib 文件夹。 lib 文件夹内部应该有与以前相同的结构(使用 nuget.exe 实用程序):

    • net40
    • net45
    • net46
    • 便携-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10
    • 点网

    所以dotnet 文件夹是所有关于 .net 核心的,只需将 .net 核心二进制文件放在那里并执行:

    nuget pack "path to your .nuspec file"
    

    然后:

    nuget setApiKey "YourNugetApiKey" -Source https://www.nuget.org/api/v2/package
    
    nuget push "path to your generated .nupkg file" -Source https://www.nuget.org/api/v2/package
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 2018-11-28
      • 2018-07-23
      • 1970-01-01
      相关资源
      最近更新 更多