Just in case others end up here as well. In case you are using codebuild + codepipeline, the problem seems to be with how the packages are zipped.
For me, what did the trick was:
version: 0.2
phases:
install:
runtime-versions:
dotnet: 4.8
commands:
- msbuild /t:restore Project.sln
build:
commands:
- echo Starting build process...
- msbuild Project.sln /t:Package /p:Configuration=Release /p:Platform="Any CPU" /p:DeployIisAppPath="Default Web Site"
- cp obj\Release\Package\Project.zip Project.zip
post_build:
commands:
- powershell Expand-Archive -Path "Project.zip" -DestinationPath "output-folder" -Force
artifacts:
files:
- '**/*'
base-directory: "output-folder"