Deployment problem after migrating from .net core 3.1 to .net 7

Same applies for Blazor: