There can be multiple steps / things you have to do for solving this issue:
Step 1:
First Check C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config
It looks to add a line under:
<system.web> (not the section under <location allowOverride="true">)
<compilation>
<assemblies>
.....
<add assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
.....
</assemblies>
There was already a <remove ... /> for this assembly at the top of that section for mine, but the add was near the bottom. Just comment this entry, and it should start working. Or if you are unsure about removing it for all websites, you could add the same line in your website web.config, with remove instead of add.
Step 2: (if you are using VS 2019)
Reinstall "AspNetDiagnosticPack.msi" can solve the problem. There will be a file in the package installation folder of the VS 2019 Installation. (The checkbox for "not delete" install packages was activated*).
If you don't have the packages, that maybe a offline installation helps.
In my case the folder was named: "Microsoft.VisualStudio.AspNetDiagnosticPack.Msi,version=16.0.12276.43788".
Richt click on "AspNetDiagnosticPack" and select "repair".
Step 3:
You need to download this MSI And execute it and select repair.
Finally, if any of above steps not solved the issue you need to download and install this new Visual Studio release in which this issue has been resolved.