Search code examples
c#.netasp.net-core.net-6.0kestrel

Microsoft.AspNetCore.Server.Kestrel.Transport.Quic - error after NET6 migration


I have already updated my app (asp.net API) from NetCore3.1 to Net6. There was no breaking changes. To build my app I use command

dotnet publish --runtime win-x64 --self-contained -c release -o build

When I run app on local env everything works fine, but when I copy package into CICD server I get error when app is starting

Could not load file or assembly 'Microsoft.AspNetCore.Server.Kestrel.Transport.Quic, Version=6.0.0.0, PublicKey=adb9...'. The system cannot find the file specified.

There is such dll in bin folder, but different version (ver 6.0.4 and public key started with f9ae). I don't understand why correct version isn't present in build folder (I publish as self-contained). How can I check where is such DLL located on my local environment (can I log it)? What should I do to finish migration to NET6?


Solution

  • I find answer, on server there was old app.runtime.json which made mess with dependencies.

    Please remember to update [app].runtime.json when you migrate from NetCore3.1 to NET6 :)