Ao usar o AWS re:Post, você concorda com os AWS re:Post Termos de uso

Lambda function - (C#/PowerShell)

0

Hello,
I would like to request your help for simple question about if it possible to code c# script bloc inside a PowerShell lambda function. Just as follow:
$code = @"
using System;
namespace HelloWorld
{
public class Program
{
public static void Main(){
Console.WriteLine("Hello world!");
}
}
}
"@

Add-Type -TypeDefinition $code -Language CSharp

My code is correct, and I can run it in PowerShell without no issue, however, when I try to execute them inside à lambda expression, I got a strange error “Could not fin part of the path ‘/var/runtime/ref’
Anyone could help me please?
Thank you

feita há 3 anos426 visualizações
1 Resposta
0

So, I didn’t know / understand the reason…., however by compiling the C# code inside a DLL and then call that DLL it works well. It’s strange but it works.
If that can help….

Thank you
Best Regards
Joao Fernandes

respondido há 3 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas