ubuntu - Rider AWS Lambda Hello World 项目错过了 libhostfxr.so
问题描述
全新的 Rider 向导生成的 AWS Lambda 项目在构建时失败:
dima@ubu:~/proj/HelloWorld2 $ dotnet --list-sdks
2.1.808 [/usr/share/dotnet/sdk]
3.1.302 [/usr/share/dotnet/sdk]
dima@ubu:~/proj/HelloWorld2 $ echo $DOTNET_ROOT
/usr/bin
dima@ubu:~/proj/HelloWorld2 $ which dotnet
/usr/bin/dotnet
dima@ubu:~/proj/HelloWorld2 $ sam build
Building function 'HelloWorldFunction'
Running DotnetCliPackageBuilder:GlobalToolInstall
Tool 'amazon.lambda.tools' was reinstalled with the latest stable version (version '4.0.0').
Running DotnetCliPackageBuilder:RunPackageAction
Build Failed
Error: DotnetCliPackageBuilder:RunPackageAction - Dotnet CLI Failed: A fatal error occurred. The required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/dima/.dotnet/tools/.store/amazon.lambda.tools/4.0.0/amazon.lambda.tools/4.0.0/tools/netcoreapp2.1/any/].
If this is a framework-dependent application, install the runtime in the global location [/snap/bin] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet/install_location].
The .NET Core runtime can be found at:
- https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=ubuntu.20.04-x64
dima@ubu:~/proj/HelloWorld2 $ find /usr/share/dotnet/host/fxr/ -name "*.so"
/usr/share/dotnet/host/fxr/2.1.20/libhostfxr.so
/usr/share/dotnet/host/fxr/3.1.6/libhostfxr.so
dima@ubu:~/proj/HelloWorld2 $ find /home/dima/.dotnet/tools/.store/amazon.lambda.tools/4.0.0/amazon.lambda.tools/4.0.0/tools/netcoreapp2.1/any/ -name "*.so"
dima@ubu:~/proj/HelloWorld2 $
更新:这是我创建项目的方式:
解决方案
推荐阅读
- javascript - 无法使用 chrome.storage.local.set 保存集
- angular - 折线图未按预期工作:角度 7
- javascript - 无法禁用 Rails 资产管道
- sql - SQL返回列中具有重复值的行
- python - 如何使用 tf.train.Checkpoint 保存大量变量
- java - 使用 maven-shade-plugin 打包时使用 Spark-Streaming 的 Spring Boot 应用程序中的“无主清单属性”
- java - ByteArrayInputStream 的 mark 方法中的参数
- kubernetes - Google Cloud GKE 多地区集群与区域集群
- ruby-on-rails - 缓存 ActiveStorage URL
- csv - 导出带有希腊字符的 CSV 时数据块机制中的问题