Unable To Install from NuGet (Could not find a part of the path...)

Jul 5, 2012 at 10:08 PM

Hello Everyone,

Perhaps there is a quick fix for this error I'm getting:

PM> Install-Package StudioShell
You are downloading StudioShell from Code Owls LLC, the license agreement to which is available at http://studioshell.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'StudioShell 1.2'.
Out-File : Could not find a part of the path 'C:\Users\USERNAME\Documents\Visual Studio 2010\Addins\StudioShell.addin'.
At \\FILESHARE\USERDIR\USERNAME\My Documents\Visual Studio 2010\Projects\APP_PS02\packages\StudioShell.1.2\tools\init.ps1:114 char:109
+ ( gc $addinSpec ) -replace '<Assembly>.+?</Assembly>',"<Assembly>$addinAssemblyPath</Assembly>" | out-file <<<< $addinFilePath;
+ CategoryInfo : OpenError: (:) [Out-File], DirectoryNotFoundException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

Import-Module : Could not load file or assembly 'file://\\FILESHARE\USERDIR\USERNAME\My Documents\Visual Studio 2010\Projects\APP_PS02\packages\StudioShell.1.2\tools\StudioShell\bin/codeowls.studioshell.cmdlets.dll' or one o
f its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At \\FILESHARE\USERDIR\USERNAME\My Documents\Visual Studio 2010\Projects\APP_PS02\packages\StudioShell.1.2\tools\init.ps1:136 char:14
+ import-module <<<< "$modulePath/StudioShell";
+ CategoryInfo : NotSpecified: (:) [Import-Module], FileLoadException
+ FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand


Thank you,


Jul 6, 2012 at 3:21 PM



The first error is caused when the Addins folder does not exist in your ~/documents/visual studio 2010 folder.  I would try uninstalling the StudioShell package, creating the Addins folder manually, and reinstalling the StudioShell package.

I've been getting a lot of issues from StudioShell and other projects related to loading binary PowerShell modules from a network share.  There seems to be CAS permissions issues when trying to load binaries from a network share using the import-module command.  Just a warning - if you happen to hit this problem you can attempt to enable fulltrust for assemblies living on the network share following the directions posted here: http://social.technet.microsoft.com/Forums/en/winserverpowershell/thread/5c422ebe-6ed3-425d-8859-5ceeb7fd4019.



Jul 6, 2012 at 7:15 PM

Hello Jim,

Thank you for your input. 
#1 error is gone. Had to fix similar (missing ...Documents\CodeOwlsLLC.StudioShell\settings.txt) using the same approach.

As for #2 those steps did not get me closer. In  .NET4 I got this warning

The .NET Framework does not apply CAS policy by default. Any settings
shown or modified by CasPol will only affect applications that opt into using
CAS policy.

Tried running VS as Administrator. NoGo. Error #2 remains.

Jul 9, 2012 at 9:21 AM

Something is not right here. I set execution policy to unrestricted, started as Admin, loaded solution from local drive, and still got errors:

The StudioShell Add-In is not loaded.  Please make sure you have the add-in enabled.
At C:\VisualStudio\APP_PS07\packages\StudioShell.1.2\tools\StudioShell\start-studioshell.psm1:69 char:8
+         throw <<<<  "The StudioShell Add-In is not loaded.  Please make sure you have the add-in enabled.";
    + CategoryInfo          : OperationStopped: (The StudioShell...add-in enabled.:String) [], RuntimeException
    + FullyQualifiedErrorId : The StudioShell Add-In is not loaded.  Please make sure you have the add-in enabled.
Import-Module : The module to process 'start-studioshell.psm1', listed in field 'NestedModules' of module manifest 'C:\VisualStudio\APP_PS07\packages\StudioShell.1.2\tools\StudioShell\StudioShell.psd1' was not
processed because no valid module was found in any module directory.
At C:\VisualStudio\APP_PS07\packages\StudioShell.1.2\tools\init.ps1:136 char:14
+ import-module <<<<  "$modulePath/StudioShell";
    + CategoryInfo          : ResourceUnavailable: (StudioShell:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand