Mam problem z dodaniem migracji do projektu. Będąc w root directory projektu używam komendy: dotnet ef migrations add "TestMigration" --startup-project KtBudget.Api
i dostaje następujący błąd:
<path>\KtBudget\obj\docker-compose.dcproj.EntityFrameworkCore.targets(4,5): error MSB4006: I
stnieje zależność cykliczna na wykresie zależności elementu docelowego, obejmująca element docelowy „GetEFProjectMetada
ta”. [<path>\KtBudget\docker-compose.dcproj]
Unable to retrieve project metadata. Ensure it's an SDK-style project. If you're using a custom BaseIntermediateOutputPath or MSBuildProjectExtensionsPath values, Use the --msbuildprojectextensionspath option.
Proszę o pomoc.
https://github.com/Krztk/KtBudget/tree/master
root:
bin
KtBudget.Api
KtBudget.Application
KtBudget.Core
KtBudget.Infrastructure
obj
volumes
.dockerignore
.gitignore
docker-compose.dcproj
docker-compose.override.yml
docker-compose.yml
KtBudget.sln
launchSettings.json
docker-compose:
version: '3.4'
services:
ktbudget.api:
image: ${DOCKER_REGISTRY-}ktbudgetapi
build:
context: .
dockerfile: KtBudget.Api/Dockerfile
postgres:
image: postgres
environment:
- POSTGRES_USER=app
- POSTGRES_PASSWORD=app
- POSTGRES_DB=mydbname
volumes:
- ./volumes/data/db:/var/lib/postgresql/data
ports:
- 5432:5432
Dockerfile KtBudget.Api:
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["KtBudget.Api/KtBudget.Api.csproj", "KtBudget.Api/"]
RUN dotnet restore "./KtBudget.Api/KtBudget.Api.csproj"
COPY . .
WORKDIR "/src/KtBudget.Api"
RUN dotnet build "./KtBudget.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./KtBudget.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "KtBudget.Api.dll"]
KtBudget.Infrastructure:
bin
Extensions
obj
Persistence
KtBudget.Infrastructure.csproj