The Issue
Using Visual Studio 2017 and attempting to add a reference to a project you receive an error stating “The operation could not be completed”.
The Solution
It seems that to bring up the Add Reference dialog in Visual Studio 2017 the Microsoft.VisualStudio.Shell.Interop.11.0.dll needs to be regsitered in the GAC. You can follow these steps to register this assembly in the GAC:
Open the Develop Command Prompt for VS2017 (ensure you run the as administrator otherwise the GAC registration may fail)
Change the current directory to the PublicAssemblies folder for your Visual Studio 2017 installation. Mine was:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies
Note: this path will be different for different versions of Visual Studio (e.g. you may find your path is C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies)
Run the following command to register the assembly in the GAC:
gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
Now restart VS2017 and try to add a reference to your project again and you should see the Add Reference dialog appear.
Wowwww.. It worked! Thank you so much for your wonderful solution.. I owe you my project. Thanks!
LikeLiked by 1 person
me salio “gacutil” no se reconoce como comando interno o externo. 😦
LikeLike
have you got the solution. same with me. not external or internal comman gacutil
LikeLike
The following links may provide the solution, let me know if they do.
http://www.sharepointpitstop.com/2015/02/gacutil-is-not-recognized-as-internal.html?m=1
https://social.msdn.microsoft.com/Forums/office/en-US/37e38e6d-182c-417b-b5fb-f1e453865f76/gacutilexe-is-not-recognized-as-an-internal-or-external-command?forum=sharepointdevelopmentlegacy
LikeLike
Thank you so much for this!
LikeLiked by 1 person
Damn thanks a lot buddy. Worked like a charm 🙂
LikeLiked by 1 person
I m getting the below ERROR.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Privat
eAssemblies>gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.
Failure adding assembly to the cache: The system cannot find the file specifie
d.
LikeLike
Is the file in that directory? It should be but if it’s not this command will fail
LikeLike
Thanks very much – you saved me.
LikeLiked by 1 person
Glad it got you out of trouble.
LikeLike
Nice this works for me in VS 2019 community, thnks.
LikeLike
Thanks .
LikeLiked by 1 person
It doesnt work for me 😦 The commands run, but when I try to add the reference still with the problem
LikeLike