Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services AWS Lambda代码管道可以';你不能修改我的deps.json文件吗?_Amazon Web Services_Aws Lambda_Amazon Cloudformation_Aws Codepipeline - Fatal编程技术网

Amazon web services AWS Lambda代码管道可以';你不能修改我的deps.json文件吗?

Amazon web services AWS Lambda代码管道可以';你不能修改我的deps.json文件吗?,amazon-web-services,aws-lambda,amazon-cloudformation,aws-codepipeline,Amazon Web Services,Aws Lambda,Amazon Cloudformation,Aws Codepipeline,我正在尝试构建和部署一个简单的示例项目来学习AWS。C#/.NET内核 我的buildspec如下所示: version: 0.2 phases: install: runtime-versions: dotnet: 2.2 pre_build: commands: - echo Restore started on `date` - dotnet restore AWSServerless1.csproj build: c

我正在尝试构建和部署一个简单的示例项目来学习AWS。C#/.NET内核

我的buildspec如下所示:

version: 0.2
phases:
  install:
    runtime-versions:
      dotnet: 2.2
  pre_build:
    commands:
      - echo Restore started on `date`
      - dotnet restore AWSServerless1.csproj
  build:
    commands:
      - echo Build started on `date`
      - dotnet publish -c release -o ./build_output AWSServerless1.csproj
artifacts:
  files:
    - ./build_output/**/*
    - scripts/**/*
    - appspec.yml
  discard-paths: yes
version: 0.0
Resources:
  - myStack-AspNetCoreFunction-1HPKUEU7I6GFW:
      Type: AWS::Lambda::Function
      Properties:
        Name: "myStack-AspNetCoreFunction-1HPKUEU7I6GFW"
        Alias: "AWSServerless1"
        CurrentVersion: "1"
        TargetVersion: "2"
我的appspec如下所示:

version: 0.2
phases:
  install:
    runtime-versions:
      dotnet: 2.2
  pre_build:
    commands:
      - echo Restore started on `date`
      - dotnet restore AWSServerless1.csproj
  build:
    commands:
      - echo Build started on `date`
      - dotnet publish -c release -o ./build_output AWSServerless1.csproj
artifacts:
  files:
    - ./build_output/**/*
    - scripts/**/*
    - appspec.yml
  discard-paths: yes
version: 0.0
Resources:
  - myStack-AspNetCoreFunction-1HPKUEU7I6GFW:
      Type: AWS::Lambda::Function
      Properties:
        Name: "myStack-AspNetCoreFunction-1HPKUEU7I6GFW"
        Alias: "AWSServerless1"
        CurrentVersion: "1"
        TargetVersion: "2"
管道成功完成,但当我尝试运行lambda时,得到了502。我查看了日志,上面写着:

Could not find the required 'AWSServerless1.deps.json'. This file should be present at the root of the deployment package.: LambdaException
当我从S3下载软件包时,对我来说,一切都在那里。这是一个zip文件,任何地方都没有路径,所有内容都在zip的根目录中,包括AWSServerless1.deps.json


有什么想法吗?

使用dotnet lambda包而不是发布