Home > Back-end >  Local build of solution works in .NET 7 but not pipeline
Local build of solution works in .NET 7 but not pipeline

Time:12-31

I have a large solution which I have updated from .NET Core 3.1 to .NET 7

This is all compiling on my local development machine

However, I get lots of failures when I build via DevOps pipeline

For example,

enter image description here

Has anyone had this issue? It really concerns me that this works on my local machine but not the pipeline and that key packages such as Auto Mapper are saying not supported on the pipeline, but compile fine locally

My pipeline is shown below

enter image description here

CodePudding user response:

I will leave this question here as the issue is subtle

The windows-latest image doesnt have a recent version of nuget installed, its only 4.1

I fixed by adding the following before the nuget task

- task: NuGetToolInstaller@1
      inputs:
        versionSpec: '6.3.1'
        checkLatest: true

CodePudding user response:

Your workaround for installing the latest nuget could be the only solution currently. You could check this github ticket Nuget_Tool_Cache_issue#16800, a lot of developers are confused with this behavior.

Same issue was observed when I was trying to investigation further in this ticket. I suppose that it could be by design that the old Nuget 4.1 could not recognize the compatibility between the packages with the latest .Net 7.0

You could also raise a feature request ticket to raise more concern for future update on this behavior.

  • Related