5

I'm having issues right now on adding reference in Visual Studio 2017. So basically, I clicked on my project to show the collapsed menu where you can see folders, properties, and references. I right clicked References and chose Add reference. An error shows up and it says "The operation could not be completed. No such interface supported".

I'm currently using Microsoft Visual Studio Community 2017 Version 15.2.

bolov
  • 72,283
  • 15
  • 145
  • 224
  • 3
    What sort of project do you have? If it is a dotnet core project, make sure you have the latest version of the framework installed (https://www.microsoft.com/net/core#windowscmd). – Aluan Haddad Jul 10 '17 at 08:20
  • Yes. It is .Net core project. I tried to reinstall VS2017 earlier. I used the installer found on the link you provided but I'm still encountering the same issue. – Peter John Paul Tactacan Jul 10 '17 at 10:42
  • I'm not sure how to diagnose that issue. Try creating a brand new dotnet core project using one of the templates that is installed along with the dotnet core workload. If you still cannot add a reference, your installation is likely corrupt (vague but not much to go on here). If you can add a reference to the new project, your existing one is likely misconfigured (perhaps due to an automatic upgrade from `project.json -> App.csproj`) – Aluan Haddad Jul 10 '17 at 11:06
  • Is this an existing .net core 1.1 app? – Ken Tucker Jul 10 '17 at 11:28

4 Answers4

13

This thread helps me resolve the issue:

https://developercommunity.visualstudio.com/content/problem/28126/unable-to-add-reference-in-visual-studio-2017-refe.html

Just to sum it up, the thread says that I need to add a certain .dll file on the cache for me to add References. Not sure why this issue occur but I hope it helps anyone who encounters the same issue.

  • 2
    The defined thread help me solve the problem - Thanks for sharing. – bsivel Sep 14 '17 at 18:25
  • 1
    Launch Developer Command Prompt for VS 2017 under Visual studio Tools and go to path where the Microsoft.VisualStudio.Shell.Interop.11.0.dll is located. OR Download from: https://drive.google.com/open?id=0BwOA9PgOV_oxSzV4V2ZvVnNmdDQ Next, in the console point your path to the DDL's location cd C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies Then Run this command: gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll – Kevin .NET Oct 06 '17 at 20:44
  • Works for VS 2019 as well, in my case. – B Pete Jan 13 '21 at 19:48
1

The above answer didn't work for me. And despite me getting the same error message as the OP (and the person on the Microsoft forum), I was not getting any information in Visual Studio's ActivityLog.xml file.

I ended up having to pack my .dll in a NuGet package and add it to the project in that way. These links were helpful:

https://www.jweiler.com/create-nuget-packages-with-vs-2017/

https://stackoverflow.com/a/48549013/253938

RenniePet
  • 11,420
  • 7
  • 80
  • 106
0

But remember, you have to add Microsoft.VisualStudio.Shell.Interop.11.0.dll not 12 or less than 11 for Visual Studio 2017 because it will not work.

Robert Daraż
  • 323
  • 2
  • 19
0

I just realized I was selecting from the list of recent references, but not using the checkbox to the left of them. I'm an idiot. Or am I? Personally, I don't like how this selection works. Why are the unchecked checkboxes hidden until I select an item? Who does this? And besides, I can select like a normal listbox but also check. Very weird to me.

Buzz
  • 512
  • 1
  • 4
  • 11