I saw on forums many users got error when publishing their ASP.NET Core 3 to server. Previously, I have discussed 502.5 error Process Failure when deploying ASP.NET Core application and how to fix Forbidden error message ASP.NET Core.
Now, here is other error that you can find when deploying your ASP.NET Core application:
How to Fix this Error
We have received few customers receive this error and we decided to write this post for other people that encounter this error message too.
To fix this error, you must
1. You need to make sure that .net core 3.1 has been installed on the server.
2. You must make sure that application pool has been setup to “No Managed Code” on IIS
3. Remove this scripts static
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "Scripts")),
RequestPath = "/Scripts"
Hope it helps!