Hello @Darren Simpson,
Welcome to Microsoft Q&A forum.
Perhaps the corresponding version of the assembly was not installed correctly, but other projects/files which referred to it failed to try to load/find it.
If you are using .NET Framework based project, please try to add <bindingRedirect> to the App.config file and check if it works. See this document: <bindingRedirect> Element for an example.
If it doesn’t work, try following methods:
- Click Tools > NuGet Package Manager > Package Manager Settings > Clear All NuGet Storage > reinstall the corresponding version(4.0.0) of "System.Runtime.InteropServices" nuget package.
- Try to download the "System.Runtime.InteropServices" nuget package manually from here: System.Runtime.InteropServices, rename the downloaded .nupkg file to .zip. Unzip it and open it > open ref > dotnet folder > find the System.Runtime.InteropServices.dll file. Open Developer Command Prompt for Visual Studio > run
cd xxxxto enter the folder which stores the .dll file(for examplecd C:\system.runtime.interopservices.4.0.0\ref\dotnet), then rungacutil -i System.Runtime.InteropServicesto install it into GAC(global assembly cache). Refer to this doc: How to: Install an assembly into the global assembly cache. - Try to repair VS from VS Installer > More > Repair.
- If all above don’t work, I suggest considering reinstalling VS.
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.