Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Publishing .net core 3.0 AWS Serverless Application - Ambiguous project name 'bootstrap'."

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?

like image 385
Andrew Rands Avatar asked Dec 06 '19 14:12

Andrew Rands


1 Answers

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.

like image 195
Norm Johanson Avatar answered Nov 07 '22 05:11

Norm Johanson