Issue:

When trying to run debugger, get the following error message…

FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Fix:

  1. Close all running instances of Visual Studio
  2. Launch the Visual Studio Developer Command Prompt as Admin
  3. Add DLL to GAC (Global Assembly Cache)
cd C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Build.Framework.dll"
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE>gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Build.Framework.dll"

Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.

Assembly successfully added to the cache

Sources:

https://ninjanetcore.blogspot.com/2018/11/could-not-load-file-or-assembly.html

Last modified: November 20, 2020

Author

Comments

Write a Reply or Comment