Learn‎ > ‎

WCF

Instalation of Web Service Software Factory Extension

posted Mar 18, 2011, 3:30 PM by Shaukat Mahmood Ahmad

This article will help you to install Web Service Software Factory 2010 Extension if you are getting failed during installation process of this guidance package on Windows XP operating system with Visual Studio 2010 Professional or Ultimate installed,  when you try yo install Web Service Software Factory 2010 Extension it is installed as a user extension under Application Data located under Documents and Settings folder, and when the installation process begins to dump extension under user directory the length of  target path exceeds the limit i,e of 260 characters. so it fails with an exception as following.

Pre-requisites 
Visual Studio 2010 SDK (Download Here)
GAX 2010 (Download Here)
............................................................
............................................................

In my case the  the selected instalation path for this extenstion was as following 

C:\Documents and Settings\shaukat.mahmood\Local Settings\Application Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft .............................................. and  so on

and this path was exceeding 260 characters, and I was getting following exception

==================================================================================
Beginning to install extension to Microsoft Visual Studio 2010 Ultimate...

Install Error : Microsoft.VisualStudio.ExtensionManager.NestedExtensionInstallException: The extension 'E3821E6E-C0AD-4F8F-B300-DE95E9776716' nested within '306C9B2B-E7C7-4E03-B4E9-F62CCD292AAB' failed to install.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. ---> System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.PathHelper.Append(Char value)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
at System.IO.Path.GetDirectoryName(String path)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.WriteFilesToInstallDirectory(InstallableExtensionImpl extension, String installPath, ZipPackage vsixPackage, Dictionary`2 extensionsInstalledSoFar, AsyncOperation asyncOp, UInt64 totalBytesToWrite, UInt64& totalBytesWritten)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallInternal(InstallableExtensionImpl extension, Boolean perMachine, Boolean isNestedExtension, Dictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, AsyncOperation asyncOp, UInt64 totalBytesToWrite, UInt64& totalBytesWritten)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallNestedExtensions(InstallableExtensionImpl parentExtension, ZipPackage parentVSIX, Boolean perMachine, Dictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, AsyncOperation asyncOp, UInt64 totalBytesToWrite, UInt64& totalBytesWritten)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.BeginInstall(IInstallableExtension installableExtension, Boolean perMachine, AsyncOperation asyncOp)
at Microsoft.VisualStudio.ExtensionManager.ExtensionManagerService.InstallWorker(IInstallableExtension extension, Boolean perMachine, AsyncOperation asyncOp)
==================================================================================

However after doing some RnD  on this topic I have devised a solution as following,

Open devenv.pkgdef  located at path   <VisualStudioRootFolder>\Common7\IDE\devenv.pkgdef  

The file can be opend in Visual Studio IDE, or using any text editor like notepad.


  This is path of Master PkgDef file that defines the well known locations for VSIX extensions.
  Now modify the Value for "UserExtensionsRootFolder" as folloowing 
    "UserExtensionsRootFolder"    = "$RootFolder$\Common7\IDE\Extensions"
This will direct VSIX extension installer to install the extension under root folder of visual studio instalation.
After making this change your extension will be installed  successfuly, but tehre is one issue, you will lose all the existing extensions taht are installed under  ...Document and Setting \ Applictaion Data .......   folder, to keep these extensions working append $AppDataLocalFolder$\Extensions; value to PkgDefSearchPath key in devenv.pkgdef file.

And  finaly you devenv.pkgdef  should look as following 

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


After making these changes run the  Web Service Software Factory 2010 Extension Installer (WSSF2010.vsix) and it will install successfully.

Note:-
 This solution is not limited to Web Service Software Factory Extension , rather it will resolve this issue for any of VSIX extension, provided it produces following exception

Install Error : Microsoft.VisualStudio.ExtensionManager.NestedExtensionInstallException: The extension 'E3821E6E-C0AD-4F8F-B300-DE95E9776716' nested within '306C9B2B-E7C7-4E03-B4E9-F62CCD292AAB' failed to install.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. ---> System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. ...

Thanks for your time.
Happy Coding.

1-1 of 1