I am developing an ASP.NET Core 3.1 API which is referring to a .NET Standard 2.1 class library. It's working fine as expected when I run the API from my local machine using Visual Studio (without any errors and warnings).
But when I am deploying using Azure DevOps, the build is failing with the below message:
Build Steps 2 error(s), 0 warning(s)
The nuget command failed with exit code(1) and error(NU1201: Project ISOXMLValidationLibrary is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Project ISOXMLValidationLibrary supports: netstandard2.1 (.NETStandard,Version=v2.1)
NU1201: Project ISOXMLValidationLibrary is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Project ISOXMLValidationLibrary supports: netstandard2.1 (.NETStandard,Version=v2.1)Errors in
D:\a\1\s\ISOXMLValidationApi\ISOXMLValidationApi\ISOXMLValidationApi.csproj NU1201: Project ISOXMLValidationLibrary is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Project ISOXMLValidationLibrary supports: netstandard2.1 (.NETStandard,Version=v2.1) Errors in D:\a\1\s\ISOXMLValidationApi\ISOXMLValidationApiTest\ISOXMLValidationApiTest.csproj NU1201: Project ISOXMLValidationLibrary is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Project ISOXMLValidationLibrary supports: netstandard2.1 (.NETStandard,Version=v2.1))
Packages failed to restore
Please let me know how to fix this issue?