.net - AWS Machine Learning Service in .NET Core
问题描述
I'd like to do a prediction in .NET Core on AWS Lambda using the Machine Learning service provided by AWS . I am getting this error. Does anyone have information about it?
Error CS0029 Cannot implicitly convert type
'System.Threading.Tasks.Task<Amazon.MachineLearning.Model.Prediction>' to
'Amazon.MachineLearning.Model.Prediction'
解决方案
When you are building .NET Core Lambda functions you are using the .NET Standard version of the AWS SDK for .NET. The .NET Standard version only supports async operations due to that is what the underlying HttpClient supports in .NET Standard. So when you use the SDK in Lambda you will have to use .NET async/await pattern when making calls. The .NET Framework version, which you are probably more used to, supports sync as well as aync method.
推荐阅读
- python - Python 泛型继承和 vscode 智能感知 (MSLS)
- json - 如何将 Json 转换为 Graphql 突变格式
- c# - 获取 SignalR Hub 而不会从“代码中的其他位置”丢失其客户
- web-scraping - Scrapy-Splash 中的 Javascript 渲染问题
- javascript - 使用生成的 Stripe 结帐按钮
- java - 将数据添加到 Firebase
- mysql - Laravel:使用别名将其他表列加入一行
- rest - Power BI 嵌入在没有 SDK 的 Dot Net Nuke 中
- machine-learning - 根据过去 3 年的季度客户数量预测未来 4 季度的客户数量
- node.js - 我可以与 PostgreSQL 一起使用的 Knex 数据类型