I upgraded my web app to the latest Asp.net Core 2.1.1 and then I pushed it to Azure App Service from GitHub directly. When I accessed my site, I got 500 and the log is showing the following
System.BadImageFormatException: at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
The docs on the exception itself is saying “The exception that is thrown when the file image of a dynamic link library (DLL) or an executable program is invalid.”, while others mentioned it's because Azure is using x86 version of the .net core.
Either way I could not figure out what exactly I need to do to resolve this issue. Thank you for any help on this.