0

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.

2
  • #1 Are you behind a proxy? #2 Try in another machine and share the results #3 Do you have installed: dotnet and nuget ? Just to try if your connectivity to nuget is ok, in the same machine install some nuget package like dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.3.9 or stackoverflow.com/a/59375752/3957754 Share the results Commented Sep 7, 2024 at 0:13
  • No proxy. As I mentioned, I tried it on my personal Windows computer and it worked fine. I also tried it on my Mac and had no issues. I do all sorts of .NET development on this computer and have no issues with NuGet other that this one that is specific to .NET Native AOT builds using SAM. Commented Sep 12, 2024 at 14:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.