I created a new .Net Core 3.0 application as per the instructions in
https://aws.amazon.com/blogs/developer/net-core-3-0-on-lambda-with-aws-lambdas-custom-runtime/
However, as soon as I added a code library project dependency, the publish failed:
publish: C:\Program Files\dotnet\sdk\3.0.100\NuGet.targets(123,5): error : Ambiguous project name 'bootstrap'
I eventually realised that the error is down to the line in aws-lambda-tools-defaults.json:
"msbuild-parameters": "--self-contained true /p:AssemblyName=bootstrap"
This switch renames every assembly to 'bootstrap', which is utterly useless. The workaround is to rename the assembly name to 'bootstrap' in the .csproj file and remove the rename switch.
Is there a way to specify that only the one specific assembly should be renamed?
As the author of the mentioned blog post I think I should have suggested to set bootstrap in the project file instead of the command line option. The problem with the command line way is like you are seeing when you have multiple projects the command line tries to set all of the project assembly names to bootstrap.
I think I will update the blog post to remove the /p:AssemblyName=bootstrap
and in the csproj file add <AssemblyName>bootstrap</AssemblyName>
like the AWSProjectType element. That would get around your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With