@kerivides

Как запустить Docker контейнер c приложением на ASP.NET?

При попытке собрать образ получаю следующую ощибку:
[build 10/10] RUN dotnet build "CustomAppApi.csproj" -c Release -o /app/build:
#18 0.851 Microsoft (R) Build Engine version 16.7.3+2f374e28e for .NET
#18 0.851 Copyright (C) Microsoft Corporation. All rights reserved.
#18 0.851 
#18 1.521   Determining projects to restore...
#18 3.444   All projects are up-to-date for restore.
#18 6.180   Ability.Core -> /app/build/Ability.Core.dll
#18 6.938   CustomAppApi.Models -> /app/build/CustomAppApi.Models.dll
#18 7.523   Ability.Services -> /app/build/Ability.Services.dll
#18 8.082 /root/.nuget/packages/buildbundlerminifier/2.6.375/build/BuildBundlerMinifier.targets(12,5): warning : /src/CustomAppApi/bundleconfig.json does not exist [/src/CustomAppApi/CustomAppApi.csproj]
#18 9.259 CSC : warning CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from /root/.nuget/packages/system.text.json/6.0.2/analyzers/dotnet/roslyn3.11/cs/System.Text.Json.SourceGeneration.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.. [/src/CustomAppApi/CustomAppApi.csproj]
#18 9.270 CSC : warning CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from /root/.nuget/packages/system.text.json/6.0.2/analyzers/dotnet/roslyn4.0/cs/System.Text.Json.SourceGeneration.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.. [/src/CustomAppApi/CustomAppApi.csproj]
#18 9.287 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/CustomAppApi/CustomAppApi.csproj]
#18 9.322 
#18 9.322 Build FAILED.
#18 9.322 
#18 9.323 /root/.nuget/packages/buildbundlerminifier/2.6.375/build/BuildBundlerMinifier.targets(12,5): warning : /src/CustomAppApi/bundleconfig.json does not exist [/src/CustomAppApi/CustomAppApi.csproj]
#18 9.323 CSC : warning CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from /root/.nuget/packages/system.text.json/6.0.2/analyzers/dotnet/roslyn3.11/cs/System.Text.Json.SourceGeneration.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.. [/src/CustomAppApi/CustomAppApi.csproj]
#18 9.323 CSC : warning CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from /root/.nuget/packages/system.text.json/6.0.2/analyzers/dotnet/roslyn4.0/cs/System.Text.Json.SourceGeneration.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.. [/src/CustomAppApi/CustomAppApi.csproj]
#18 9.323 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/CustomAppApi/CustomAppApi.csproj]
#18 9.323     3 Warning(s)
#18 9.323     1 Error(s)
#18 9.323 
#18 9.323 Time Elapsed 00:00:08.35
------
executor failed running [/bin/sh -c dotnet build "CustomAppApi.csproj" -c Release -o /app/build]: exit code: 1


Файл Program.cs с методом Main присутствует.
С чем она связана и как ее можно исправить?
  • Вопрос задан
  • 108 просмотров
Пригласить эксперта
Ответы на вопрос 2
firedragon
@firedragon
Senior .NET developer
CustomAppApi.csproj
program.cs

в студию и вывод dotnet -v
а так же какая версия используется в проекте.
У меня предположение что версии не совпадают
Ответ написан
Комментировать
Viji
@Viji
Associate DevOps Engineer
dotnet restore до билда не забыли?
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы