-
-
Notifications
You must be signed in to change notification settings - Fork 431
Support for dotnet? #52
Comments
Unfortunately this is a lot harder than the other languages, because replacing a single class in a .NET DLL is virtually impossible without having the original source. I'm waiting on some support from AWS for this – I'll let you know when they get back to me |
Hi @mhart, Any updates on this? Cheers |
@joaoasrosa sure! How much do you know about disassembling and reassembling .NET DLLs? If you can replicate the same way I do it in Java, that'd be a huge help: https://github.com/lambci/docker-lambda/blob/master/java8/run/lambda-runtime-mock/build.sh#L7-L14 |
@mhart Is there a |
Actually it looks like #68 is attempting to address this issue. |
@mhart and @jason-riddle if you do not mind I can take a look to #68 and try from there. |
The key diffrence between the .NET and the Java implementation ist that the .NET runtime is bootstraped from a NATIVE binary using native memory and native libraries... |
@romanlum it's actually still a compiled .NET binary though, and the libraries are .NET DLLs, except for the library that speaks to the AWS Lambda management layer, but that's the same with Java – that also uses a native library for that functionality, which is the only part I mock out. Ideally the only part that is mocked out is just the part that communicates with the Lambda management layer – so that all of the rest of the code has the same behavior as it does on Lambda itself (eg, changing the way things are logged, or redirecting stdout or whatever). |
I don't think that the file /var/runtime/awslambda (which is the original entrypoint) is a compiled .net application. |
Unfortunately we cannot use the original bootstrap.dll because there is a bug in the entrypoint which prevents us from replacing the lambda runtime as you did in java.
As you can see they are setting assemblyPath twice :(
so this if can never be true :( |
In my implementation I used the internal classes from the original bootstrap.dll so the loading and parsing of the data is the same as with the original runtime |
@romanlum you are right, it does appear to be a binary compiled from C, not .NET – my apologies! |
In dotnetcore1.0, the
I haven't checked if it's the same for 2.0? |
its the same |
Is it possible to patch a dll file? Or would it be “easier” just to decompile the dll, fix the bug, and then recompile? Also, I’m guessing that the dll is signed by Amazon correct? |
The dll is not signed, but the native binary awslambda is calling the bootstrap.dll so you cannot add commandline arguments that easy . If you look at my code in the pull request you can see that i am using the internal UserCodeLoader, so it is the same as if the bootstrap.dll would have been called. |
@mhart there are further developments on this front? Anything where we can help? |
Update: #68 has been merged which adds support for dotnet core 2.0. |
Oh yeah, forgot we also had an issue open. .NET Core 2.0 is now supported! I'm going to close this out. If there's really a lot of ppl asking for .NET Core 1.0 support, I could look at adding that, but I feel like it's pretty low priority now that 2.0 is out. |
I use C# for my lambda and want to test it in local. AWS point to here that we can test lambda locally by this docker. Would you pleased to add C# dotnet in this too?
The text was updated successfully, but these errors were encountered: