Skip to content

Issue building .Net Core 3.1 Package - (potential issues with the home directory?) #350

@DizzyLeChuck

Description

@DizzyLeChuck

I have recently been migrating my .Net API to Core 3.1 in order to take advantage of the ReadyToRun features for quicker cold starts in Lambda as detailed at https://aws.amazon.com/blogs/compute/announcing-aws-lambda-supports-for-net-core-3-1/.

I finished doing migrating all the code and it all builds locally and runs. I updated the task in my pipeline to be as follows.

  • task: LambdaNETCoreDeploy@1
    displayName: 'Create Severless API Package'
    inputs:
    awsCredentials: AWS
    command: deployServerless
    packageOnly: true
    packageOutputFile: $(Build.ArtifactStagingDirectory)\serverless.template
    lambdaProjectPath: path/to/project.csproj
    s3Bucket: 'bucketname'
    additionalArgs: '--msbuild-parameters "/p:PublishReadyToRun=true --self-contained false'

Looking in the logs, I can see the Amazon Lambda Tools are getting installed here

Since you just installed the .NET Core SDK, you will need to logout or restart your session before running the tool you installed.
You can invoke the tool using the following command: dotnet-lambda
Tool 'amazon.lambda.tools' (version '4.0.0') was successfully installed.

But then later on it fails with this error

Performing package-only build of serverless application, output template will be placed in /home/vsts/work/1/a\serverless.template
/usr/bin/dotnet lambda package-ci -ot /home/vsts/work/1/a\serverless.template --s3-bucket bucketname --disable-interactive true --msbuild-parameters /p:PublishReadyToRun=true --self-contained false
Could not execute because the specified command or file was not found.
Possible reasons for this include:

  • You misspelled a built-in dotnet command.
  • You intended to execute a .NET Core program, but dotnet-lambda does not exist.
  • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

##[error]Error: The process '/usr/bin/dotnet' failed with exit code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions