2

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
2
  • I have the exact same issue. I can't seem to find a solution to build multiple projects together in one solution. Commented Jul 26, 2023 at 11:44
  • Has anyone find solution for this? I'm having the exact same issue while deploying a .NET 6 solution that contains multiple projects. I was following this doc: cloud.google.com/appengine/docs/flexible/dotnet/… Commented Apr 16, 2024 at 13:19

1 Answer 1

1

this solution worked for me, https://purple.telstra.com/blog/net-core-on-google-cloud. Basically, you will need to add cloudbuild.yaml file to your solution and specify the entry project. enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.