how to fix dotnet core build issue on new jenkins windows agent server
Hi Team,
I'm building new jenkins agent on windows 2019 server for dotnet core build .
the dotnet SDKs installed are same as old server which is working fine . but on new server the post build package microsoft.extensions.dependency.model.dll is referring to 2.1.0.0 version which suppose to be with 3.0.19 version. on old server its correctly referring to 3.0.19 version . i dont know why the new server is referring to 2.1.0 version and from where its being referred is unclear.
microsoft.extensions.dependency.model.dll - this dll is getting referred from serilog.settings.configuration reference in csproj file . I have tried adding separate package reference for that dll with 3.0.0 version but still its referring to 2.1.0 version after the build .
But what I observerd is the dll from following path is "Firm.API\bin\Release\net6.0" correctly referring to 3.0.19.** version but why output directory if referring to 2.1.0 version is the issue . I have installed dotnet core 2,3,6 SDKs on the new server . so currently the dotnet.exe is referring to 6.0 version .
Below are the commands we are using for dotnet core build project ,
Command to Restore Nuget dependencies: "C:\Program Files\dotnet\dotnet.exe" -s https://nexus-prod.com/repository/nuget-group/
Build command: "C:\Program Files\dotnet\dotnet.exe" publish --no-restore -c Release -o "D:\jenkins\workspace\firm-merge-dev-to-feature-branch\API"
Its not working on new jenkins agent only but old agent which is running on 2012 os is working fine .but we need to demise 2012 OS server soon. so please help advise on above issue.