Stylecop is interfering with EfBundle creation in docker image in gitlab CI

82 Views Asked by At

I have stylecop configured in my project and when I run RUN dotnet ef migrations bundle --project {CSPROJ_PATH}.csproj -r alpine.3.7-x64 --self-contained --configuration Bundle -o /build/migrationbundle --verbose to create ef bundle for my docker image in gitlab CI, I get stylecop errors and it fails to create EF bundle.enter image description here

How can I generate EF bundle while creating docker image in gitlab CI or how can I disable stylecop for only generating efbundle step in gitlab CI

1

There are 1 best solutions below

0
mialkin On

I was using the latest beta version 1.2.0-beta.556 of StyleCop.Analyzers NuGet package and I had similar problem.

Fixed the problem by upgrading .NET SDK Docker image to the latest version.

In my particular case upgrade was: mcr.microsoft.com/dotnet/dotnet/sdk:8.0 -> mcr.microsoft.com/dotnet/sdk:8.0.203