I am new in asp.net core and azure. I have small web app on asp.net core mvc, and I want to publish this project to azure. Locally the project work fine, but when I try to build the project through the console on azure, this error appears -
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.Identity.Core, Version=2.1.6.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at program.Startup.ConfigureServices(IServiceCollection services)
When i try to open across his link I see this: An error occurred while starting the application. .NET Core 4.6.27129.04 X86 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.1.1-rtm-30846 | Microsoft Windows 10.0.14393 | Need help?
And my question is: What I need to do, to fix this error ?
I'm getting a very similar error on my core 2.1 site published as an Azure App Service:
It was running perfectly until it suddenly stopped working. I honestly don't know why the issue started but in the mean time I solved it by changing the "Deployment Mode" to "Self-Contained" on the publish profile settings.
To get there just right click your website, click on publish, select your profile and click on Configure. Then click on Settings and change the "Deployment Mode". That will add all the ddl's locally and get your site working again.
Visual Studio publish profile