{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-extensions-for-dotnet-cli/issues/26","repository_url":"https://api.github.com/repos/aws/aws-extensions-for-dotnet-cli","labels_url":"https://api.github.com/repos/aws/aws-extensions-for-dotnet-cli/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-extensions-for-dotnet-cli/issues/26/comments","events_url":"https://api.github.com/repos/aws/aws-extensions-for-dotnet-cli/issues/26/events","html_url":"https://github.com/aws/aws-extensions-for-dotnet-cli/issues/26","id":351816424,"node_id":"MDU6SXNzdWUzNTE4MTY0MjQ=","number":26,"title":"Bug: Publish optimization uses a hardcoded runtime linux-x64","user":{"login":"derwasp","id":10754345,"node_id":"MDQ6VXNlcjEwNzU0MzQ1","avatar_url":"https://avatars0.githubusercontent.com/u/10754345?v=4","gravatar_id":"","url":"https://api.github.com/users/derwasp","html_url":"https://github.com/derwasp","followers_url":"https://api.github.com/users/derwasp/followers","following_url":"https://api.github.com/users/derwasp/following{/other_user}","gists_url":"https://api.github.com/users/derwasp/gists{/gist_id}","starred_url":"https://api.github.com/users/derwasp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derwasp/subscriptions","organizations_url":"https://api.github.com/users/derwasp/orgs","repos_url":"https://api.github.com/users/derwasp/repos","events_url":"https://api.github.com/users/derwasp/events{/privacy}","received_events_url":"https://api.github.com/users/derwasp/received_events","type":"User","site_admin":false},"labels":[{"id":745854398,"node_id":"MDU6TGFiZWw3NDU4NTQzOTg=","url":"https://api.github.com/repos/aws/aws-extensions-for-dotnet-cli/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-18T12:21:20Z","updated_at":"2018-08-23T09:25:25Z","closed_at":null,"author_association":"NONE","body":"[LambdaDotNetCLIWrapper.cs](https://github.com/aws/aws-extensions-for-dotnet-cli/blob/92c7a3d91ad5167d82949c88130c03335fffa18b/src/Amazon.Lambda.Tools/LambdaDotNetCLIWrapper.cs#L97) has the following optimization, which is supposed to make the resulting zip smaller:\r\n\r\n```csharp\r\n                // If you set the runtime linux-x64 it will trim out the Windows and Mac OS specific dependencies but Razor view precompilation\r\n                // will not run. So only do this packaging optimization if there are no Razor views.\r\n                if (Directory.GetFiles(fullProjectLocation, \"*.cshtml\", SearchOption.AllDirectories).Length == 0)\r\n                {\r\n                    arguments.Append(\" -r linux-x64 --self-contained false /p:PreserveCompilationContext=false\");\r\n                }\r\n```\r\n\r\nHowever, 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.\r\nAn example of such a package would be [LibGit2Sharp.NativeBinaries](https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries/):\r\n\r\n![image](https://user-images.githubusercontent.com/10754345/44299186-9414a880-a2f1-11e8-8496-5f9b639521cc.png)\r\n\r\n**Temporary workaround**:\r\n\r\nAdd an empty `.cshtml` file and a dependency to `Microsoft.AspNetCore.Razor` so the if in the optimization above is ignored."},"comment":{"url":"https://api.github.com/repos/aws/aws-extensions-for-dotnet-cli/issues/comments/415351627","html_url":"https://github.com/aws/aws-extensions-for-dotnet-cli/issues/26#issuecomment-415351627","issue_url":"https://api.github.com/repos/aws/aws-extensions-for-dotnet-cli/issues/26","id":415351627,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTM1MTYyNw==","user":{"login":"derwasp","id":10754345,"node_id":"MDQ6VXNlcjEwNzU0MzQ1","avatar_url":"https://avatars0.githubusercontent.com/u/10754345?v=4","gravatar_id":"","url":"https://api.github.com/users/derwasp","html_url":"https://github.com/derwasp","followers_url":"https://api.github.com/users/derwasp/followers","following_url":"https://api.github.com/users/derwasp/following{/other_user}","gists_url":"https://api.github.com/users/derwasp/gists{/gist_id}","starred_url":"https://api.github.com/users/derwasp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derwasp/subscriptions","organizations_url":"https://api.github.com/users/derwasp/orgs","repos_url":"https://api.github.com/users/derwasp/repos","events_url":"https://api.github.com/users/derwasp/events{/privacy}","received_events_url":"https://api.github.com/users/derwasp/received_events","type":"User","site_admin":false},"created_at":"2018-08-23T09:25:25Z","updated_at":"2018-08-23T09:25:25Z","author_association":"NONE","body":"@normj well, my PR worked ;) I even have a test there!"}}
{"actor":{"display_login":"derwasp"}}