I have been having issues adding a MySql.Data.dll
to the deployment package of my powershell
lambda functions. I have manually copied the dll
to the AWSPowershell.NetCore
directory and it appears in the modules folder of the deployed lambda function. However, I cannot find a way to get the dll
into the base location of the lambda function's deployment package nor a way to access it if it's in the modules folder.
Lambda structure:
lamda-function.ps1 <- import <- layer.ps1(Layer)
The dll
resides in the modules folder of lambda-function's deployment package and layer.ps1 is attempting to invoke the command causing the issue.
Line causing the error:
[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data");
Error received:
- [Information] - Error Message: Exception calling "LoadWithPartialName"
with "1" argument(s): "Could not load file or assembly 'MySql.Data.dll,
Culture=neutral, PublicKeyToken=null'. Operation is not supported. (Exception
from HRESULT: 0x80131515)"
- [Information] - Error in Line:[void]
[System.Reflection.Assembly]::LoadWithPartialName("MySql.Data.dll");
Areas where my MySql.Data.dll file has been added:
- C:\path\Documents\PowerShell\Modules\AWSPowerShell.NetCore\3.3.335.0
- C:\Program Files\PowerShell\6
Information regarding my environment:
Powershell 6
from my local machine..NET Core 2.1
(C#/PowerShell)User contributions licensed under CC BY-SA 3.0