PathTooLongException when I install Visual Studio extension

2.4k Views Asked by At

I am having trouble installing Visual Studion 2010 extension:

Install Error : System.IO.PathTooLongException: C:\Users\felix.DOMAIN\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Vendor\Vendor 2011 Developer Tools\1.0\ProjectTemplates\CSharp\XYZ\1033\Vendor.XyzDeveloperTools.XyzPackageProject.zip

I install the extension by double-clicking .vsix files; so I don't have an option to shorten Vendor 2011 Developer Tools into, say VendorTools. Is there any other (more manual) way to install the extension?

By the way, the total length is 199 characters; I thought it is way less than 248 chars limit. I use Win7 64-bit if it makes a difference

4

There are 4 best solutions below

0
On

From codeplex

  1. take the vsix file, open with zip or rar, extract to a convenient location, open the extracted folder,
  2. open the extension manifest with notepad, add some short name inside the name tag E.g. <Name>V</Name>
  3. zip the complete folder, rename the zip file extension to vsix
  4. click on vsix and execute.
2
On

If you get the error while trying to install the add-in, the only one solution I've tried that worked is taken from this resource, thanks to Pedro Rainho:

You should try this:

  1. Close all instances of Visual Studio 2010.
  2. Go to C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE, or where you have installed your Visual Studio 2010.
  3. Locate and edit the file devenv.pkgdef in a text editor, like notepad.
  4. Your file should contain something like this:

[$Initialization$] "ApplicationExtensionsFolder" = "$RootFolder$\Common7\IDE\Extensions" "PkgDefSearchPath" = "$ApplicationExtensionsFolder$;$RootFolder$\Common7\IDE\CommonExtensions;$RootFolder$\Common7\IDE\devenv.admin.pkgdef;" "UserExtensionsRootFolder" = "$AppDataLocalFolder$\Extensions" "RegistryRoot" = "Software\Microsoft\VisualStudio\10.0"

This File contains the locations of VSIX instalations. You should edit UserExtensionsRootFolder And specify a new folder. Ex:

Change this:

"UserExtensionsRootFolder"    = "$AppDataLocalFolder$\Extensions"

To this:

"UserExtensionsRootFolder"    = "C:\Extensions"

5- Save the file and install the extension. Now all your VSIX extensions will be installed to C:\Extensions

NOTE: I'm using a Vistual Studio 2010 Ultimate with Windows XP 64 bits. Of course "C:\Extensions" it is just an example.

2
On

I am getting total length = 193, not 199 - either way it shouldn't throw that exception.

Anyways, have a look at

How to avoid System.IO.PathTooLongException

0
On

It's weird error and started getting this when ever I install a new extension.

Try the following command as an administrator after closing all Visual Studio instances.

devenv.exe /InstallVSTemplates

It may happen again if you install a new extension. If so, then run the above command again.