From my Azure pipeline, I have since today an error while restoring the nugets:
[error]The nuget command failed with exit code(1) and error(C:\Program Files\dotnet\sdk\2.1.519\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2.
I can't seem to find a solution to my problem.
6 months ago everything worked fine.
My code has not changed.
Hi @Ludo-CVS. Thank you for your feedback and we regret that you're experiencing difficulties. Unfortunately, I'm not able to determine what library you're working with from the context. Can you please help me understand what library you're referring to, which version, and a bit more about the context of the projects that are consuming the library and being built from your pipeline? That will help me find the right folks to assist.
Hi @jsquire
My csproj :
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
<LangVersion>7</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.15.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="4.0.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.3.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.2" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.2.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.2.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.22.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.9" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="PetaPoco.Compiled" Version="6.0.459" />
<PackageReference Include="Unity" Version="5.11.7" />
Error log :
SolutionName="GatewayProxy"
2020-10-30T15:44:35.0422852Z NuGet.CommandLine.ExitCodeException: Exception of type 'NuGet.CommandLine.ExitCodeException' was thrown.
2020-10-30T15:44:35.0423228Z at NuGet.CommandLine.MsBuildUtility.
2020-10-30T15:44:35.0423565Z --- End of stack trace from previous location where exception was thrown ---
2020-10-30T15:44:35.0423868Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2020-10-30T15:44:35.0424205Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2020-10-30T15:44:35.0424584Z at NuGet.CommandLine.RestoreCommand.
2020-10-30T15:44:35.0424908Z --- End of stack trace from previous location where exception was thrown ---
2020-10-30T15:44:35.0425209Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2020-10-30T15:44:35.0425560Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2020-10-30T15:44:35.0425924Z at NuGet.CommandLine.RestoreCommand.
2020-10-30T15:44:35.1054092Z ##[error]The nuget command failed with exit code(1) and error(C:\Program Files\dotnet\sdk\2.1.519\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2.
Configuration Azure
Azure DevOps Pipeline
.net core 2.1
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ahmedelnably, @fabiocav.
Hi @Ludo-CVS. I'm still uncertain as to your application environment or recent changes. I'm assuming Azure Functions is in use here given the project file and references, so we'll start there. Though I'm also seeing versions in your other references that appear to have been updated recently, such as the Identity Client version that was released only three days ago.
Can you help us understand when you last updated package versions?
@fabiocav, @ahmedelnably: Not sure that we've got this routed correctly. I'd very much appreciate your thoughts.
I put all the nuget used to you, thinking that this will solve the problem ... but it didn't change anything.
The problem does not come from the updates of the nugets
This the Get-Package of my solution
Id | Versions
Microsoft.NETCore.App | {2.2.0}
Microsoft.Identity.Client | {4.22.0}
Microsoft.NETCore.App | {2.2.0}
Newtonsoft.Json | {12.0.3}
Microsoft.NETCore.App | {2.2.0}
PetaPoco.Compiled | {6.0.459}
Microsoft.Extensions.DependencyI... | {3.1.9}
Microsoft.NETCore.App | {2.2.0}
FluentMigrator | {3.2.9}
FluentMigrator.Runner | {3.2.9}
Microsoft.NETCore.App | {2.2.0}
MSTest.TestFramework | {2.1.2}
System.Collections.Concurrent | {4.3.0}
MSTest.TestAdapter | {2.1.2}
Moq | {4.14.7}
NFluent | {2.7.0}
Microsoft.NETCore.App | {2.2.0}
Microsoft.NET.Test.Sdk | {16.7.1}
MSTest.TestFramework | {2.1.2}
MSTest.TestAdapter | {2.1.2}
Microsoft.NETCore.App | {2.2.0}
Microsoft.NET.Test.Sdk | {16.7.1}
MSTest.TestFramework | {2.1.2}
MSTest.TestAdapter | {2.1.2}
Microsoft.NETCore.App | {2.2.0}
Microsoft.NET.Test.Sdk | {16.7.1}
MSTest.TestFramework | {2.1.2}
MSTest.TestAdapter | {2.1.2}
NFluent | {2.7.0}
Microsoft.NETCore.App | {2.2.0}
Microsoft.NET.Test.Sdk | {16.7.1}
MSTest.TestFramework | {2.1.2}
MSTest.TestAdapter | {2.1.2}
NFluent | {2.7.0}
Microsoft.NETCore.App | {2.2.0}
Microsoft.NET.Test.Sdk | {16.7.1}
MSTest.TestFramework | {2.1.2}
MSTest.TestAdapter | {2.1.2}
NFluent | {2.7.0}
Microsoft.NETCore.App | {2.2.0}
Microsoft.NET.Test.Sdk | {16.7.1}
Microsoft.NETCore.App | {2.2.0}
Newtonsoft.Json | {12.0.3}
Microsoft.NETCore.App | {2.2.0}
Newtonsoft.Json | {12.0.3}
Microsoft.Extensions.Logging | {3.1.9}
Microsoft.NETCore.App | {2.2.0}
Microsoft.ApplicationInsights | {2.15.0}
Microsoft.Azure.ServiceBus | {5.0.0}
Microsoft.NETCore.App | {2.2.0}
Newtonsoft.Json | {12.0.3}
Microsoft.NETCore.App | {2.2.0}
CompareNETObjects | {4.67.0}
Microsoft.NETCore.App | {2.2.0}
Microsoft.NETCore.App | {2.2.0}
Newtonsoft.Json | {12.0.3}
Microsoft.NETCore.App | {2.2.0}
Microsoft.Azure.WebJobs.Script.E... | {1.2.0}
PetaPoco.Compiled | {6.0.459}
Newtonsoft.Json | {12.0.3}
Unity | {5.11.7}
Microsoft.NET.Sdk.Functions | {3.0.9}
Microsoft.Azure.WebJobs.Extensio... | {4.2.0}
Microsoft.Azure.WebJobs.Extensio... | {3.0.2}
Microsoft.NETCore.App | {2.2.0}
Microsoft.ApplicationInsights | {2.15.0}
Microsoft.Azure.WebJobs.Extensions | {4.0.1}
Microsoft.Azure.WebJobs.Extensio... | {2.3.1}
Microsoft.Identity.Client | {4.22.0}
Can you verify your build agent in Azure Pipeline?
It might be vs2017-win2016.
If yes, please change it to windows-2019.
That worked for me.
That good,
Thank you
Most helpful comment
Can you verify your build agent in Azure Pipeline?
It might be vs2017-win2016.
If yes, please change it to windows-2019.
That worked for me.