Any idea how to solve this. I tried updating nuget packages. But it did not solve the problem. TargetFramework is net6.0.
Error is very clear from the error message.
This package doesn't support .Net 6.
It supports only the .net framework, not the .net core. So you should not use it in .Net 6 target framework apps.
Microsoft.ApplicationInsights.Web also doesn't support .Net 6.