Search code examples
visual-studiovisual-studio-extensionsvsixsidewaffle

Extension could not be found. Please make sure the extension has been installed


I've been working on a VS extension that creates a couple of files with some boilercode using SideWaffle and I was having a problem where, whenever I'd add a new item, my boilercode item would be under "My Custom Templates". I found this in the template-builder.props file and updated it to "Test", but when I tried again I had both "My Custom Templates" and "Test", both of which contained the same extension.

I figured VS might have cached the old name or something, so I uninstalled the extension from VS and restarted. Now the project won't build at all and gives the error:

Extension 'ProjName..00000000-0000-0000-0000-000000000000' could not be found.
Please make sure the extension has been installed.

I tried re-installing the extension using the .vsix in the Debug folder and restarting VS, but I get the same error). I could find nothing online about this and, to be honest, I'm confused as to why the project needs itself to be installed to build.

What can I do to get this project building again?


Solution

  • After a bit of playing around I was able to figure out a solution to my problem:

    I can see that an extension is added to the experimental instance of Visual Studio when you successfully build the project (I've found no other way of installing the extension (VS2013)). If you try to build the project without the extension installed on the experimental instance, the build fails.

    Of course, this would mean that you could never build the project, because you need to build it to install the extension, and the extension needs to be installed for the project to build. Only on the very first build of the project is this not true. You can build without the extension installed, which will then install the extension on the experimental instance and allow future builds of the project.

    If, like me, you uninstall the extension on the experimental instance, you're going to get into a catch-22 situation where the build fails, because the extension isn't installed, and you can't install the extension, because the build fails.

    The solution to this was simple enough. I just had to run the project, at which point the build would fail, then choose to run the project from the last successful build. This will open the experimental instance without the extension installed, however, if you close the experimental instance, you can then build the project successfully, which will install the extension again.

    I don't know exactly why this fixes the problem, but I'd love to know if anyone has any ideas.