dotnet包不适用于Azure功能(为Nuget打包Azure功能)



我有一个Azure函数项目,在.csproj文件中有以下设置:

<IsPackable>true</IsPackable>
<PackageId>Product.Services.Subscriptions</PackageId>
<Version>1.0.0</Version>
<Authors>MyCompany</Authors>
<Company>MyCompany</Company>

当我为它执行dotnet pack时,什么都不会发生(没有创建.nupkg文件(。我看到的输出:

Microsoft (R) Build Engine version 16.11.1+3e40a09f8 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.

我做错了什么吗?或者应该怎么做?

我做错了什么吗?或者应该如何工作?

这是azure函数中的默认设计。dotnet包将无法打包azure函数。默认情况下,IsPackable属性似乎设置为false,即使手动更改也无济于事。dotnet cli不会为azure函数创建.nupkg文件,但它可以为其他dotnet项目创建。

参考文献:

  1. .net核心-如何为AzureFunctions V2创建NuGet包
  2. 使用nuget"时无法生成nuget包;Microsoft.NET Sdk函数";在图书馆项目中

最新更新