-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'dotnet lambda publish-layer' fails in .NET 6 with ‘--enable-package-optimization true’ #208
Comments
Not sure if we need to remove package optimizations feature for .NET 6 (displaying proper error message) or to research more on |
@ashishdhingra it looks like Microsoft is removing support for |
Would love an answer to this please - is there any work around to publish a lambda layer :( |
@controdave There are 2 workarounds for publishing a layer still, do either of these help for now?
|
Awe shucks, will there be a performance knock at all with remove package optimization? Thank you sir! |
Describe the bug
When trying to publish a .NET 6 layer, if you try to enable package optimizations, you will get an exception complaining about crossgen not existing in the tools directory of the .NET 6 SDK. It seems crossgen is no longer included with .NET 6 tools. And it sounds like this is by design according to this issue: dotnet/sdk#24752
Example command that throws the error:
dotnet lambda publish-layer dotnetsixlayer --layer-type runtime-package-store --s3-bucket my-layer-store-bucket --region us-east-1 --package-manifest ./layer-test-manifest.csproj --enable-package-optimization true --framework net6
Either removing the
--enable-package-optimization true
or downgrading to .NET 5 fixes the problem.Expected Behavior
Publishes the layer to the store
Current Behavior
Reproduction Steps
On an AL2 VM, create a file
layer-test-manifest.csproj
with a NuGet reference in it, then run this command:dotnet lambda publish-layer dotnetsixlayer --layer-type runtime-package-store --s3-bucket my-layer-store-bucket --region us-east-1 --package-manifest ./layer-test-manifest.csproj --enable-package-optimization true --framework net6
Possible Solution
This open issue mentions using
FrameworkReferences
Additional Information/Context
No response
Targeted .NET platform
.NET 6
CLI extension version
Package Id Version Commands
amazon.lambda.testtool-3.1 0.12.1 dotnet-lambda-test-tool-3.1
amazon.lambda.testtool-5.0 0.12.0 dotnet-lambda-test-tool-5.0
amazon.lambda.testtool-6.0 0.12.1 dotnet-lambda-test-tool-6.0
amazon.lambda.tools 5.3.0 dotnet-lambda
nbgv 3.4.255 nbgv
Environment details (OS name and version, etc.)
Windows 10, Amazon Linux 2
The text was updated successfully, but these errors were encountered: