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
I was using the latest beta version
1.2.0-beta.556ofStyleCop.AnalyzersNuGet 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