aws / aws/aws-toolkit-visual-studio

AWS Lambda Function and Microsoft.Data.SqlClient and Mock Lambda Tool

Open
#112 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
135
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Visual Studio Version 16.6.4
DotNet version 3.1.302

Step 1: Create a Lambda function empty.
Step 2: Debug using the Mock lambda tool. All is well.
Step 3: Add nuget package Microsoft.Data.SqlClient (no code was added)
Step 4: Debugging produces:

AWS .NET Core 3.1 Mock Lambda Test Tool (0.10.0)
Unknown error occurred causing process exit: Dependency resolution failed for component C:\Dev\SourceControl\Development\Test\AWSLambda1\bin\Debug\netcoreapp3.1\AWSLambda1.dll with error code -2147450740. Detailed error: Error:
An assembly specified in the application dependencies manifest (AWSLambda1.deps.json) was not found:
package: 'Microsoft.Data.SqlClient.SNI.runtime', version: '2.0.0'
path: 'runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll'

at System.Runtime.Loader.AssemblyDependencyResolver..ctor(String componentAssemblyPath)
at Amazon.Lambda.TestTool.Runtime.LambdaAssemblyLoadContext..ctor(String lambdaPath) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\Runtime\LambdaAssemblyLoadContext.cs:line 28
at Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.Initialize(String directory, IAWSService awsService) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 71
at Amazon.Lambda.TestTool.Runtime.LocalLambdaRuntime.Initialize(String directory) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\Runtime\LocalLambdaRuntime.cs:line 46
at Amazon.Lambda.TestTool.TestToolStartup.Startup(String productName, Action`2 uiStartup, String[] args, RunConfiguration runConfiguration) in C:\codebuild\tmp\output\src142363207\src\Tools\LambdaTestTool\src\Amazon.Lambda.TestTool\TestToolStartup.cs:line 77

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the AWS .NET Core 3.1 Mock Lambda Test Tool after adding Microsoft.Data.SqlClient to an otherwise empty Lambda function. Start by reading LambdaAssemblyLoadContext.cs and LocalLambdaRuntime.cs at the stack-trace locations, then inspect AWSLambda1.deps.json and the missing Microsoft.Data.SqlClient.SNI.runtime dependency. Done means debugging starts without the dependency-resolution process exit.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp, sql
Domain
testing, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.