I feel like an idiot for asking such a basic question but here goes... I'm trying out AWS Lambda in C# for the first time and according to the docs:
Anything written to standard out or standard error - using Console.Write or a similar method - will be logged in CloudWatch Logs.
OK well upon execution I get the following runtime exception:
Unable to load DLL 'api-ms-win-core-processenvironment-l1-1-0.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E): DllNotFoundException
at Interop.mincore.GetStdHandle(Int32 nStdHandle)
at System.ConsolePal.GetStandardFile(Int32 handleType, FileAccess access)
at System.Console.<>c.<get_Out>b__25_0()
at System.Console.EnsureInitialized[T](T& field, Func`1 initializer)
at System.Console.WriteLine(String value)
My question is, how / where am I supposed to add the reference it's asking for? The answer seems non obvious.
As an alternative to Console.Write or Console.WriteLine, you can use the Log method on the static Amazon.Lambda.Core.LambdaLogger class.
private void DoSomething() {
LambdaLogger.Log("Log message");
}
Some more info can be found here: http://docs.aws.amazon.com/lambda/latest/dg/dotnet-logging.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With