Hello everyone,
I created a new function in the GCP Cloud Function UI with a .NET 8.0 runtime environment. After creation, I reviewed the default sample code. Without making any modifications to the sample code, I clicked “Save and redeploy”. The build subsequently failed, and the error log is as follows:
Running "dotnet restore --packages /layers/google.dotnet.publish/packages ./HelloHttp.csproj (DOTNET_CLI_TELEMETRY_OPTOUT=true)"
Welcome to .NET 8.0!
---------------------
SDK Version: 8.0.410
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Determining projects to restore...
Restored /workspace/HelloHttp.csproj (in 5.37 sec).
Done "dotnet restore --packages /layers/google.dotnet.publish/pack..." (7.044184858s)
--------------------------------------------------------------------------------
Running "dotnet publish -nologo --verbosity minimal --configuration Release --output /layers/google.dotnet.publish/publish/bin --no-restore --packages /layers/google.dotnet.publish/packages ./HelloHttp.csproj (DOTNET_CLI_TELEMETRY_OPTOUT=true)"
HelloHttp -> /workspace/bin/Release/net8.0/HelloHttp.dll
HelloHttp -> /layers/google.dotnet.publish/publish/bin/
Done "dotnet publish -nologo --verbosity minimal --configuration R..." (4.864082044s)
Determined runtime version from GOOGLE_ASP_NET_CORE_VERSION: 8.x.x
WARNING: Deleted folder: /workspace/bin
Determining entrypoint from output directory /layers/google.dotnet.publish/publish/bin and project file ./HelloHttp.csproj
=== .NET - Runtime (google.dotnet.runtime@0.9.1) ===
Determined runtime version from GOOGLE_ASP_NET_CORE_VERSION: 8.x.x
--------------------------------------------------------------------------------
failed to build: building the runtime layer: (error ID: 3d9223eb):
invalid version specified: Invalid Semantic Version. You may need to use a different builder. Please check if the language version specified is supported by the os: ubuntu2204. You can refer to https://cloud.google.com/docs/buildpacks/builders for a list of compatible runtime languages per builder
--------------------------------------------------------------------------------
Sorry your project couldn't be built.
Our documentation explains ways to configure Buildpacks to better recognise your project:
-> https://cloud.google.com/docs/buildpacks/overview
If you think you've found an issue, please report it:
-> https://github.com/GoogleCloudPlatform/buildpacks/issues/new
--------------------------------------------------------------------------------
ERROR: failed to build: exit status 1
Finished Step #2 - "build"
ERROR
ERROR: build step 2 "asia-east1-docker.pkg.dev/serverless-runtimes/google-22-full/builder/dotnet:dotnet_20250623_RC00" failed: step exited with non-zero status: 51
This issue does not occur when the runtime environment is set to Node.js 22. Currently, I’ve experienced this problem with .NET 8 and Java 21 runtime environments. Help?
