Home » Visual StudioRSS

Extension failing to uninstall in Visual Studio 2010

I created a custom extension in VS2010. I have it installed in VS2010 main hive. I am having trouble uninstalling it.

When I go to Tools->Extension Manager, it shows me this extension. Option to Disable it is greyed out, only uninstall is active. When I click on uninstall button, it throws error "Can not create a file when that file already exists".

Next I tried running "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE>VSIXInstaller.exe" /u:<GUID> of installed extension, I got following exception:



9/14/2010 12:35:49 AM - Microsoft Visual Studio Extension Installer
9/14/2010 12:35:50 AM - -------------------------------------------
9/14/2010 12:35:50 AM - Initializing Uninstall...
9/14/2010 12:35:50 AM - Found installed product - Microsoft Visual Studio 2010 Professional
9/14/2010 12:35:50 AM - Extension Details...
9/14/2010 12:35:50 AM -     Identifier      : e9e257ab-a25b-4119-92a4-71d449f6bb3b
9/14/2010 12:35:50 AM -     Name            : MyExtension
9/14/2010 12:35:50 AM -     Author          : AuthorName
9/14/2010 12:35:50 AM -     Version         : 1.0.0.0
9/14/2010 12:35:50 AM -     Description     : Description
9/14/2010 12:35:50 AM -     Locale          : en-US
9/14/2010 12:35:50 AM -     MoreInfoURL     : http://www.jazz.net/
9/14/2010 12:35:50 AM -     InstalledByMSI  : False
9/14/2010 12:35:50 AM -     MinFramework    : 4.0
9/14/2010 12:35:50 AM -     MaxFramework    : 4.0
9/14/2010 12:35:50 AM -
9/14/2010 12:35:50 AM -     Supported Visual Studio Editions :
9/14/2010 12:35:50 AM -         Version : 10.0
9/14/2010 12:35:50 AM -             Ultimate
9/14/2010 12:35:50 AM -             Premium
9/14/2010 12:35:50 AM -             Pro
9/14/2010 12:35:50 AM -
9/14/2010 12:35:50 AM -     Supported Isolated Shells :
9/14/2010 12:35:50 AM -
9/14/2010 12:35:50 AM -     References      :
9/14/2010 12:35:50 AM -         -------------------------------------------------------
9/14/2010 12:35:50 AM -         Identifier   : Microsoft.VisualStudio.MPF
9/14/2010 12:35:50 AM -         Name         : Visual Studio MPF
9/14/2010 12:35:50 AM -         MinVersion   : 10.0
9/14/2010 12:35:50 AM -         MaxVersion   :
9/14/2010 12:35:50 AM -         MoreInfoURL  :
9/14/2010 12:35:50 AM -         Nested       : No
9/14/2010 12:35:50 AM -
9/14/2010 12:35:50 AM -
9/14/2010 12:35:50 AM - Uninstalling 'MyExtension', version 1.0.0.0.
9/14/2010 12:35:50 AM - System.IO.IOException: Cannot create a file when that file already exists.

   at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.Uninstall(IInstalledExtension extension)
   at VSIXInstaller.App.UninstallExtensionFromSKU(String vsixID, SupportedVSSKU sku)

 

I searched for all occurrences of the GUID of my extension in registry, and deleted it. I also removed the extensions marked deleted in "HKLM\Microsoft\VisualStudio\10.0\ExtensionManager\PendingDeletions" in registry.

But the extension refuses to get uninstalled. Any help will be much appreciated.

 

1 Answer Found

 

Answer 1

I was able to find a solution to this. I read somewhere that when we try to uninstall  an extension, it is marked deleted, and is deleted later.

I had my extension  dll and vsixmanifest file installed in $VS2010InstallDir\Common7\IDE\Extensions. I looked in that directory, there already existed files which marked my extension for deletion. There were 2 files created by VS, "Mypackage.pkgdef.deleteme" and "extension.vsixmanifest.deleteme" in the directory. When I was trying to uninstall my extension through Tools->Extension Manager, or using VSIXInstaller.exe, VS was trying to create the same 2 files, to mark it as deleted. So it failed with IOException, since the files already existed. I am not sure how VS reached this state, but deleting these 2 "*.deleteme" files did the trick.

If I had installed my extension by copying in the user Appdata area, simply deleting extension folder in the Appdata area would have done the job.

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter