Skip to content

Inability to use Serverless template variables #1078

@zaus

Description

@zaus

Description

Expected to be able to use Serverless Framework self variables throughout the template .yml. Instead tool fails with GUI reporting:

FileLoadException: The given assembly name or codebase was invalid. (0x80131047)

Reproduction Steps

  1. aws-lambda-tools.default.json indicates template serverless.yml
  2. serverless.yml looks like with variable ${self:service} where service name matches project/folder name
    service: My.Namespace.And.Solution.Project
    
    provider:
      name: aws
      runtime: dotnetcore3.1
    
    package:
      individually: true
    
    functions:
      hello:
        handler: ${self:service}::${self:service}.Handler::HelloWorld
            ...
  3. launch.json in VSCode calls "program": "/Users/${env:USERNAME}/.dotnet/tools/dotnet-lambda-test-tool-3.1"
  4. Run debugging tool, GUI opens in browser with "Stack" tab showing error and trace
  5. Replace all instances of variable in serverless.yml template with explicit service name
  6. Run debugging tool, GUI opens in browser with working mock testing tool

Logs

?

Environment

  • Build Version: dotnet-lambda-test-tool-3.1 v0.10.0, dotnet-lambda v5.2.0
  • OS Info: Windows 10 Pro
  • Build Environment: VSCode + dotnet
  • Targeted .NET Platform: Core 3.1

Resolution

Maybe the pre-parsing/transpiling is a feature that hasn't been implemented yet? Or is this specific to Serverless runtimes?


This is a 🐛 bug-report

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions