尝试通过AWS Lambda连接到我的SQL Server Express RDS实例时出现以下错误System.Data.SqlClient
:
"errorType":"PlatformNotSupportedException",
"errorMessage":"此平台不支持该操作.",
"stackTrace":[
"System.Runtime.InteropServices.OSPlatform.get_Windows()",
"at System.Data.SqlClient" .SNI.SNITCPHandle.d__22.MoveNext()"
]
我使用Amazon.Lambda.Tools构建部署包.运行该函数并从本地连接到数据库工作正常,但在尝试在AWS Lambda上运行时失败.
这是我的project.json
:
{ "version": "1.0.0-*", "description": "AWS lambda Console Application", "authors": [ "" ], "packOptions": { "tags": [], "projectUrl": "", "licenseUrl": "" }, "buildOptions": { "emitEntryPoint": true }, "dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0" }, "Newtonsoft.Json": "9.0.1", "Amazon.Lambda.Core": "1.0.0*", "Amazon.Lambda.Serialization.Json": "1.0.1", "Amazon.Lambda.Tools": { "type": "build", "version": "1.0.0-preview1" }, "Dapper": "1.50.2", "System.Data.SqlClient": "4.3.0" }, "tools": { "Amazon.Lambda.Tools": "1.0.0-preview1" }, "commands": { "AwsLambda": "run" }, "frameworks": { "netcoreapp1.0": { "imports": "dnxcore50" } } }
John Ten Cat.. 5
有同样的问题,对我来说只是改变
"System.Data.SqlClient": "4.3.0"
至
"System.Data.SqlClient": "4.1.0"
为我工作.我没有必要更改NetCore.App依赖项.
有同样的问题,对我来说只是改变
"System.Data.SqlClient": "4.3.0"
至
"System.Data.SqlClient": "4.1.0"
为我工作.我没有必要更改NetCore.App依赖项.