A known-working PowerShell project created previously in the same version of
Visual Studio
suddenly refuses to load
[📸 screenshot needed]
This solution will suggest resetting the MEF component cache followed by deleting (or renaming/moving) the related
Visual Studio
local appdata directory.
1. Backup the
Visual Studio
settings to file
[1]
. An example filename would be
Exported-2023-09-01.vssettings
.
1. Clear the MEF component cache. The best way to do so is with the
Clear MEF Component Cache
extension by Mads Kristensen
[2]
. You could also manually deleting the files
[3]
.
(figure shows the Clear MEF Component Cache feature added to the Visual Studio Tools menu)
Procedure 2
1. Be sure you have exited
Visual Studio
completely and that the devenv.exe
process is not running.
2. Move/Rename/Delete the local cache directory (e.g.
C:\Users\Username\AppData\Local\Microsoft\VisualStudio
) per example below.
(figure shows a typical Visual Studio local appdata directory on a Windows workstation)
3. Restart
Visual Studio.
4. Import the settings file you exported earlier.
Procedure 3
1. If all else fails, re-installing Visual Studio is the next best option.
2. If re-installing Visual Studio does not help, then consider trying a different workstation.