Package Publishing Step Fails for .NET 8 Azure Functions App

Chidiebere Ugwu 25 Reputation points
2024-07-19T14:27:22.47+00:00
I have a .Net 8 Project running in an Azure Function App and I am using via Azure devops pipeline as CICD. Everything runs fine without issue. Now I amhaving some problems, I have not make a code change, I am only adding a postman test to be included via Azure devops pipeline. However the pipeline jobs fails on publishing package step. Before ever getting to postman testing, so I know for sure, it has nothing to do with my change.

Here is the error:

```bash
Publish Package

View raw log

Starting: Publish Package
==============================================================================
Task         : .NET Core
Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
Version      : 2.238.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
==============================================================================
Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
/opt/hostedtoolcache/dotnet/dotnet publish /home/vsts/work/1/s/Functions/Functions.csproj --no-restore --configuration Release --output /home/vsts/work/1/App -p:version=1.0.1-DEVS-101_PostmanTest
MSBuild version 17.9.8+b34f75857 for .NET
  Copying IronPdf files from /home/vsts/.nuget/packages/ironpdf.native.chrome.windows/2024.1.143/buildTransitive/netstandard2.0/../../runtimes to build directory for target framework net8.0 on Windows...
/opt/hostedtoolcache/dotnet/sdk/8.0.204/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.GenerateAssemblyInfo.targets(226,5): error NETSDK1018: Invalid NuGet version string: '1.0.1-DEVS-101_PostmanTest'. [/home/vsts/work/1/s/Functions/Functions.csproj]

##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Dotnet command failed with non-zero exit code on the following projects : [
  '/home/vsts/work/1/s/Functions/Functions.csproj'
]
Finishing: Publish Package

Here is the pipeline task it fails on:

    - task: DotNetCoreCLI@2
      name: Publish_Package
      displayName: Publish Package
      inputs:
        command: publish
        publishWebProjects: false
        projects: $(Project)
        arguments: --no-restore --configuration Release --output $(Pipeline.Workspace)/App -p:version=$(Build.BuildNumber)
        modifyOutputPath: false

Any pointers to what might be wrong will be helpful.


Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,958 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,829 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dimitri Bstls 0 Reputation points
    2024-08-07T13:09:27.16+00:00

    Hello,
    It seems the version for postmanTest package is not good.
    You can read in the error message as follows :

    Invalid NuGet version string: '1.0.1-DEVS-101_PostmanTest'

    So the change is related to your changes with postman apparently.

    Hope this helps,
    Dimitri.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.