-
|
How can i deploy my .Net 8 AOT AWS Lambda project when the project has a dependency? Repo: https://github.com/cacowen/ImageServer To test out the build I was running the sam/build-dotnet8 docker container: Fresh clone from GitHub - never opened in Visual Studio - works as expected: After opening in VisualStudio, before building within vs or after, no difference: While VisualStudio is still open, removing the OBJ and BIN folders from both projects and trying again results in the same MSB4018 errors as above, but VisualStudio shows the error: Running "Publish to AWS Lambda" by right clicking on the ImageServer project and selecting the option provides the same MSB4018 errors. If I remove the LambdaHelpers dependency (and adjust the code accordingly) I get no errors and things work as expected. I imagine I probably have some configuration setting messing things up, but I do not know what to change. Other threads and searches suggested adding the .dockerignore file, deleting the OBJ and BIN folders, and ensuring the fallback package folder exists, and clearing cache. I did all of these with the same results. I created the repo and steps to reproduce the issue. Tested this on 2 machines with the same results. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I think you have a typo in the I'm not sure |
Beta Was this translation helpful? Give feedback.
I think you have a typo in the
LambdaHelpers.csprojwith theTrimModeproperty. You have set tolinkbut it is supposed to be capitalized asLink. When I cloned your repo and made that change I was able to build for Native AOT.I'm not sure
TrimModeis what you want to use for a class library. Seems like Microsoft has moved away from that attribute since there isn't a lot of documentation on it. Instead what we use in our libraries is<IsTrimmable>true</IsTrimmable>.