簡體   English   中英

Google 應用引擎部署失敗:[9] 發生內部錯誤 [...] 您必須安裝或更新 .NET 才能運行此應用程序

[英]Google app engine deployment failing: [9] An internal error occurred [...] You must install or update .NET to run this application

我正在嘗試在 App Engine 上部署 .NET 7 應用程序,但出現以下錯誤:

錯誤

Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2022-12-01T04:02:39.227Z143518.vt
.1: You must install or update .NET to run this application.

App: /app/Cyclee.API.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
.NET location: /usr/share/dotnet/

The following frameworks were found:
  7.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=debian.11-x64

如果我理解得很好,服務器似乎缺少正確的 do.net 版本來運行該應用程序。 這些是我的 app.yaml 和 Dockerfile:

應用程序.yaml

runtime: custom
env: flex

# 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/python/configuring-your-app-with-app-yaml
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

env_variables:
  ConnectionStrings__SqlDatabase: 

Dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 8080
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["Cyclee.API/Cyclee.API.csproj", "Cyclee.API/"]
COPY ["Cyclee.API.Domain/Cyclee.API.Domain.csproj", "Cyclee.API.Domain/"]
COPY ["Cyclee.API.Infrastructure/Cyclee.API.Infrastructure.csproj", "Cyclee.API.Infrastructure/"]
RUN dotnet restore "Cyclee.API/Cyclee.API.csproj"
COPY . .
WORKDIR "/src/Cyclee.API"
RUN dotnet build "Cyclee.API.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Cyclee.API.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Cyclee.API.dll"]

正如 Jon Skeet 所指出的,我只需要將項目從 .NET 6 重新定位到 .NET 7。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM