【问题标题】:Is one dll can be both dotnet tool and nuget?一个dll可以同时是dotnet工具和nuget吗?
【发布时间】:2019-09-09 06:05:02
【问题描述】:

创建 dotnet 工具就像创建 nuget 包。我们通过dotnet pack 命令创建它并将其发布到nuget 提要。

但是我们不能在我们的 C# 项目中使用它作为 nuget 包,虽然它是一个nuget

我可以创建一个控制台应用程序项目并将其发布为dotnet tool,然后将其用作 C# 项目中的 nuget 包吗?

【问题讨论】:

    标签: c# nuget dotnet-tool


    【解决方案1】:

    将您的工具发布为 NuGet 包,将您发布到的目录添加到 NuGet 源(VS:Tool>Options>NuGet>big-green-plus-button)。 在你想要使用 NuGet 包的项目中打开 NuGet 包管理器并选择你的源,等待 NuGet 加载,然后安装你发布的 NuGet 工具

    【讨论】:

    • 这就是如何将工具发布为 nuget。但是在这些步骤之后,我可以将这个 nuget 安装为 dotnet 全局工具和 nuget 吗?
    猜你喜欢
    • 2011-08-27
    • 2016-11-13
    • 2019-03-06
    • 1970-01-01
    • 2022-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-24
    相关资源
    最近更新 更多