I am exploring the Google Cloud with .NET Core project and trying to publish .NET 6 Web API app on App Engine Flex. My solution consists of multiple projects, exactly 4 class library projects referenced in one Web API project. I have already created projects and enabled the required APIs on GCP, setup google cloud CLI on my machine. The application starts deploying on running the following command from my Web API project directory
gcloud app deploy
but build is failing with error message
"Reference Project Not Found"
Step #2 - "build": Skipping project "/******csproj" because it was not found.
Step #2 - "build": Skipping project "/******.csproj" because it was not found.
Step #2 - "build": Skipping project "/******.csproj" because it was not found.
Step #2 - "build": Skipping project "/******.csproj" because it was not found.
Step #2 - "build": Skipping project "/******csproj" because it was not found.
Step #2 - "build": Skipping project "/******.csproj" because it was not found.
Step #2 - "build": Skipping project "/******.csproj" because it was not found.
Step #2 - "build": Restored /workspace/******.csproj (in 189 ms).
Step #2 - "build": Done "dotnet restore --packages /layers/google.dotnet.publish/pack..." (2.797299621s)
Step #2 - "build": WARNING: A project file was uploaded, causing `dotnet publish` to be called, but the output bin folder already existed in application source. Deleting /layers/google.dotnet.publish/publish/bin.
Step #2 - "build": --------------------------------------------------------------------------------
Step #2 - "build": Running "dotnet publish -nologo --verbosity minimal --configuration Release --output /layers/google.dotnet.publish/publish/bin --no-restore --packages /layers/google.dotnet.publish/packages ./******.csproj (DOTNET_CLI_TELEMETRY_OPTOUT=true)"
Step #2 - "build": /layers/google.dotnet.sdk/sdk/sdk/6.0.411/Microsoft.Common.CurrentVersion.targets(2066,5): warning : The referenced project '../******.csproj' does not exist. [/workspace/******.csproj]
So then I tried moving the app.yaml file out of my Web API project directory and put it in the solution directory and ran the deploy command from the solution directory. This time also the build failed but with different error message
"expected to find exactly one project file in directory"
Step #2 - "build": Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>.
Step #2 - "build": === .NET - Publish ([email protected]) ===
Step #2 - "build": --------------------------------------------------------------------------------
Step #2 - "build": Running "find . -regex .*\\.\\(cs\\|fs\\|vb\\)proj"
Step #2 - "build": ./******.csproj
Step #2 - "build": ./******.csproj
Step #2 - "build": ./******.csproj
Step #2 - "build": ./******.csproj
Step #2 - "build": ./******.csproj
Step #2 - "build": Done "find . -regex .*\\.\\(cs\\|fs\\|vb\\)proj" (5.549085ms)
Step #2 - "build": Failure: (ID: 46b43786) expected to find exactly one project file in directory ., found [./******.csproj ./******.csproj ./******.csproj ./******.csproj ./******.csproj]
Step #2 - "build": --------------------------------------------------------------------------------
Step #2 - "build": Running "mv -f /builder/outputs/output-6447353496926691534 /builder/outputs/output"
Step #2 - "build": Done "mv -f /builder/outputs/output-6447353496926691534 /builder/o..." (8.697702ms)
Step #2 - "build": ERROR: failed to build: exit status 1
Finished Step #2 - "build"
ERROR
ERROR: build step 2 "us.gcr.io/gae-runtimes/buildpacks/google-gae-22/dotnet/builder:dotnet_20230703_RC00" failed: step exited with non-zero status: 51
Can someone please help? Thanks!
EDIT-1 - Adding app.yaml file content for reference -
runtime: aspnetcore
env: flex
runtime_config:
operating_system: ubuntu22
# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/dotnet/configuring-your-app-with-app-yaml
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
