I am intergrating a c# project to use AWS codebuild with a ubuntu linux OS. All target frameworks are 3.1. For some reason when running this on AWS codebuild it looks for 2.0? When following the link it throws to resolve the error Microsoft clearly states to use 3.1
I have tried to use TargetFramework and RuntimeFrameWork in .csproj
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeFrameworkVersion>3.0.*</RuntimeFrameworkVersion>
As well I have even created a global.json
{
"sdk": {
"version": "3.1.5",
"rollForward": "latestFeature"
}
}
My command to build is
dotnet restore
dotnet lambda package --configuration release --framework netcoreapp3.1 --output-package bin/release/netcoreapp3.1/foo-bar.zip
The error I get continues to be:
The framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
- The following frameworks were found:
3.1.5 at [/root/.dotnet/shared/Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=ubuntu.18.04-x64
Why does it continue to try to build with dotnet core 2.0? I am using visual studio code on a mac and using the same build command on my mac build correctly in 3.1 with no errors thrown.