C
C#2y ago
froxerbbq

After upgrading .net from 3.1 to 6.0 We are getting this error in the pipeline Create ef migrations

dotnet exec step seem to be targetting old frameworks, we have updated EF as well. 2022-12-02T16:31:10.8266249Z Build succeeded. 2022-12-02T16:31:10.8493102Z dotnet exec --depsfile /home/vsts/work/1/s/Api/bin/Debug/netcoreapp3.1/zxy.zxy.zxy.Api.deps.json --additionalprobingpath /home/vsts/.nuget/packages --runtimeconfig /home/vsts/work/1/s/Api/bin/Debug/netcoreapp3.1/zxy.zxy.zxy.Api.runtimeconfig.json /home/vsts/.dotnet/tools/.store/dotnet-ef/6.0.4/dotnet-ef/6.0.4/tools/netcoreapp3.1/any/tools/netcoreapp2.0/any/ef.dll migrations script --context DBContext --output /home/vsts/work/1/a/migrations/DBContext.sql --idempotent --assembly /home/vsts/work/1/s/Api/bin/Debug/netcoreapp3.1/zxy.zxy.zxy.Api.dll --project /home/vsts/work/1/s/Api/zxy.zxy.zxy.Api.csproj --startup-assembly /home/vsts/work/1/s/Api/bin/Debug/netcoreapp3.1/zxy.zxy.zxy.Api.dll --startup-project /home/vsts/work/1/s/Api/zxy.zxy.zxy.Api.csproj --project-dir /home/vsts/work/1/s/Api/ --root-namespace zxy.zxy.zxy.Api --language C# --framework netcoreapp3.1 --working-dir /home/vsts/work/1/s --verbose
1 Reply
froxerbbq
froxerbbq2y ago
My best guess would be that since it seem to be using bin, it is a attempting to use things from a older build to exec a current updated. Is there a way to clear obj and bin on build server? But on the build server, it would be spinning up a new container? How is it using bin from a old build Figured it out, in a build step it was building 3.1. Removed step and script worked.