gpt4 book ai didi

visual-studio-code - 使用 Visual Studio 代码的 AWS Lambda

转载 作者:行者123 更新时间:2023-12-04 17:44:31 29 4
gpt4 key购买 nike

我只是尝试使用 Visual Studio Code 处理 AWS lambda 函数并按照 this 中的步骤操作链接

在我运行 dotnet lambda 时执行所有步骤后,我不断收到以下错误。我所有的包都是最新的,而且我正在使用 core 2.1

PS C:\Lambda> dotnet lambda --help
No executable found matching command "dotnet-lambda"

我的项目文件:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="1.0.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.4.0" />
</ItemGroup>

</Project>

这是我的项目结构,由模板创建

enter image description here

VS 代码版本

enter image description here

另外,当我运行 dotnet --help 时,我什至没有在 sdk 中看到 dotnet lambda

dotnet --help
.NET Command Line Tools (2.1.403)
Usage: dotnet [runtime-options] [path-to-application] [arguments]

Execute a .NET Core application.

runtime-options:
--additionalprobingpath <path> Path containing probing policy and assemblies to probe for.
--additional-deps <path> Path to additional deps.json file.
--fx-version <version> Version of the installed Shared Framework to use to run the application.
--roll-forward-on-no-candidate-fx Roll forward on no candidate shared framework is enabled.

path-to-application:
The path to an application .dll file to execute.

Usage: dotnet [sdk-options] [command] [command-options] [arguments]

Execute a .NET Core SDK command.

sdk-options:
-d|--diagnostics Enable diagnostic output.
-h|--help Show command line help.
--info Display .NET Core information.
--list-runtimes Display the installed runtimes.
--list-sdks Display the installed SDKs.
--version Display .NET Core SDK version in use.

SDK commands:
add Add a package or reference to a .NET project.
build Build a .NET project.
build-server Interact with servers started by a build.
clean Clean build outputs of a .NET project.
help Show command line help.
list List project references of a .NET project.
migrate Migrate a project.json project to an MSBuild project.
msbuild Run Microsoft Build Engine (MSBuild) commands.
new Create a new .NET project or file.
nuget Provides additional NuGet commands.
pack Create a NuGet package.
publish Publish a .NET project for deployment.
remove Remove a package or reference from a .NET project.
restore Restore dependencies specified in a .NET project.
run Build and run a .NET project output.
sln Modify Visual Studio solution files.
store Store the specified assemblies in the runtime package store.
test Run unit tests using the test runner specified in a .NET project.
tool Install or manage tools that extend the .NET experience.
vstest Run Microsoft Test Engine (VSTest) commands.

Additional commands from bundled tools:
dev-certs Create and manage development certificates.
ef Entity Framework Core command-line tools.
sql-cache SQL Server cache command-line tools.
user-secrets Manage development user secrets.
watch Start a file watcher that runs a command when files change.

Run 'dotnet [command] --help' for more information on a command.

有人可以指导我吗

谢谢

最佳答案

我遇到了类似的问题, No executable found matching command "dotnet-lambda"

下面是我的修复

dotnet tool install --global Amazon.Lambda.Tools --version 3.1.2

enter image description here

关于visual-studio-code - 使用 Visual Studio 代码的 AWS Lambda,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52742616/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com