首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Google应用程序引擎部署失败:[9]发生内部错误[.]必须安装或更新.NET才能运行此应用程序。

Google应用程序引擎部署失败:[9]发生内部错误[.]必须安装或更新.NET才能运行此应用程序。
EN

Stack Overflow用户
提问于 2022-12-01 04:45:52
回答 1查看 41关注 0票数 0

我试图在应用程序引擎上部署一个.NET 7应用程序,但我得到了以下错误:

错误

代码语言:javascript
运行
复制
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

如果我能理解的话,服务器似乎缺少了运行该应用程序的正确的dotnet版本。这些是我的app.yaml和Dockerfile:

app.yaml

代码语言:javascript
运行
复制
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

代码语言:javascript
运行
复制
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"]
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-12-02 04:12:57

正如Jon所指出的,我只需要推迟从.NET 6到.NET 7的项目。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74637022

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档