Bug: Publish optimization uses a hardcoded runtime linux-x64
See original GitHub issueLambdaDotNetCLIWrapper.cs has the following optimization, which is supposed to make the resulting zip smaller:
// If you set the runtime linux-x64 it will trim out the Windows and Mac OS specific dependencies but Razor view precompilation
// will not run. So only do this packaging optimization if there are no Razor views.
if (Directory.GetFiles(fullProjectLocation, "*.cshtml", SearchOption.AllDirectories).Length == 0)
{
arguments.Append(" -r linux-x64 --self-contained false /p:PreserveCompilationContext=false");
}
However, if one has a dependency on some native libraries using nuget packages and such a dependency package has a bunch of monikers and not only linux or linux-x64, but e.g. rhel-x64, the resulting output is unusable, since the publish result will contain a wrong library.
An example of such a package would be LibGit2Sharp.NativeBinaries:

Temporary workaround:
~Add an empty .cshtml file and a dependency to Microsoft.AspNetCore.Razor so the if in the optimization above is ignored.~
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Publish optimization uses a hardcoded runtime linux-x64 ...
Description. I fixed this issue 2 years ago(#26), and now it seems like it's back. Starting with #112 the linux-x64 moniker is used...
Read more >.NET Core Self-Contained and Framework-Dependent ...
In this post, I explain the difference between framework-dependent deployments and self-contained deployments, review the pros and cons of each, ...
Read more >In angular 8, when uplaod the build error occurs due to ...
I am used ng build --prod --aot --build-optimizer command to build the app. angular · Share.
Read more >ampproject/toolbox-runtime-version
Use it to query cdn.ampproject.org for the current release or canary version of the AMP Runtime. Uses a stale-while-revalidate caching strategy to avoid ......
Read more >bash - error while loading shared libraries
I am using Ubuntu 10.10.) g++ -o ex_addinst ./ex_addinst.o -L/home/li/work/tools/lindo/lindoapi/bin/linux64 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Interesting. I’ll take a look to see how we can better handle this.
Nothing wrong with the PR. I have the PR staged with the next release. I’m going to close this and use the https://github.com/aws/aws-extensions-for-dotnet-cli/pull/29 to track it.