John Barnes
John Barnes

Reputation: 69

Can't build a C# Native AOT Lambda using sam build on Windows

I am trying to get familiar with building and deploying Native AOT C# Lambdas in order to improve our cold starts and to see if we get any additional benefits. I created a hello world project using the sam init template for C#, .NET 8, and Native AOT. When I run sam build on Windows 11, I get the following error. Appreciate any help here. I can't seem to find a solution.

Executing publish command
Starting container for native AOT build using build image: public.ecr.aws/sam/build-dotnet8:latest-x86_64.
... invoking 'docker run --name tempLambdaBuildContainer-27d26a30-23bd-41a8-b8d7-4c1748e40d0d --rm --volume "C:\dev\Playground\HelloWorldAot":/tmp/source/ -i public.ecr.aws/sam/build-dotnet8:latest-x86_64 dotnet publish
"/tmp/source/src/HelloWorldAot" --output "/tmp/source/src/HelloWorldAot\bin\Release\net8.0\publish" --configuration "Release" --framework "net8.0" --runtime linux-x64 /p:GenerateRuntimeConfigurationFiles=true --self-contained True
/p:StripSymbols=true' from directory C:\dev\Playground\HelloWorldAot
... docker run:   Determining projects to restore...
... docker run: /tmp/source/src/HelloWorldAot/HelloWorldAot.csproj : error NU1301: Unable to load the service index for source https://api.nuget.org/v3/index.json.
... docker run:   Failed to restore /tmp/source/src/HelloWorldAot/HelloWorldAot.csproj (in 5.79 sec).
ERROR: Container build returned 1

screenshot of error in terminal

Update: Looks like this may be a problem with my work issued computer. I tried it on my personal computer and it worked as expected. Leaving this open on the chance anyone has any ideas.

Upvotes: 0

Views: 110

Answers (0)

Related Questions