@zhuq Thank you for reaching out to Microsoft Q&A. Apologize for the inconvenience caused on this.
Can you check the contents of the \bin folder for hosted web app. If you do NOT have System.Runtime.CompilerServices.Unsafe.dll in bin folder, then try to remove the <bindingRedirect/> setting from the web.config file and then the app will pick up the newer version that our extension brings.
If you don't want to remove the <bindingRedirect/> setting then please try changing the binding redirect version in your web.config file in your app service to below
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1"/>
</dependentAssembly>
if you have file System.Runtime.CompilerServices.Unsafe.dll in your \bin folder, then as a workaround, you can revert to the older App Insights extension version by going into App Service settings and manually set ApplicationInsightsAgent_EXTENSION_VERSION = 2.8.43
Feel free to reach back to me if you have any questions on this.