Hello @drago314 , @Hoang Duc Manh ,
Welcome to Microsoft Q&A forum.
There are many causes about this error. The error message mentioned “could not load it”, so maybe something blocked it from loading(e.g. permission limitation), maybe the assembly file was corrupted so VS failed to load it, maybe the assembly file is missing or maybe there’s a different version of the same assembly file which was also detected by VS and cause confliction…
The Microsoft.VisualStudio.Diagnostics.Assert.dll(version 17.0.0.0) file is stored in C:\Program Files\Microsoft Visual Studio\2022\edition\Common7\IDE\PrivateAssemblies
folder. Since you have repaired and reinstalled VS, I think it exists and is good for using. Perhaps you need to check if there’s a different/same version of Microsoft.VisualStudio.Diagnostics.Assert.dll file which was installed in GAC(Global Assembly Cache) by running gacutil -l command in VS Developer Command Prompt. Try to uninstall it by using gacutil -u Microsoft.VisualStudio.Diagnostics.Assert
command(you may backup the assembly first in %windir%\Microsoft.NET\assembly
folder).
Besides, some other extensions/programs which are working/running along with VS may affect the loading process. You may try reinstalling them or, uninstalling them > reinstalling VS > reinstalling them. For permission issues, you may try running VS as administrator. For other cache issues, try resetting VS(run devenv /ResetSettings command in VS Developer Command Prompt) and if you previously modified some other things like Registry, system file, system settings, try recovering them and test again.
Anyways, I'm happy to hear that installing VS 2019 solved your issue.
Best Regards,
Tianyu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.