Код: Выделить всё
Install-Package -ProjectName $ProjectName -Id Unity -Version 2.1.505.2 -Source nuget.org -Verbose -FileConflictAction IgnoreAll -ErrorAction Stop -WarningAction Ignore -IncludePrerelease
Код: Выделить всё
Поначалу все работает нормально:< /p>
Код: Выделить всё
Added package 'Unity.2.1.505.2' to folder 'c:\%SOLUTION_BASE_PATH%\packages' from source '
https://api.nuget.org/v3/index.json'
Added reference 'Microsoft.Practices.Unity.Configuration' to project:'X'. The Reference was Resolved To Package (resolvedToPackage):'True', where Reference Path from DTE(dteOriginalPath):'C:\%SOLUTION_BASE_PATH%\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.Configuration.dll' and Reference Path from package reference(assemblyFullPath):'c:\%SOLUTION_BASE_PATH%\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.Configuration.dll'.
Added reference 'Microsoft.Practices.Unity' to project:'X'. The Reference was Resolved To Package (resolvedToPackage):'True', where Reference Path from DTE(dteOriginalPath):'C:\%SOLUTION_BASE_PATH%\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.dll' and Reference Path from package reference(assemblyFullPath):'c:\%SOLUTION_BASE_PATH%\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.dll'.
Added package 'Unity.2.1.505.2' to 'packages.config'
Код: Выделить всё
Executing script file 'c:\%SOLUTION_BASE_PATH%\packages\Unity.2.1.505.2\tools\install.ps1'
Exception calling "Substring" with "1" argument(s): "startIndex cannot be larger than length of string.
Parameter name: startIndex"
At C:\%SOLUTION_BASE_PATH%\packages\Unity.2.1.505.2\tools\Utils.psm1:71 char:12
+ return ($targetPath.Substring($basePath.Length)).TrimStart([Syste ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentOutOfRangeException
Код: Выделить всё
Removed package 'Unity.2.1.505.2 : CommonServiceLocator [1.0.0, )' from 'packages.config'
Removed reference 'Microsoft.Practices.Unity.Configuration.dll' from project 'X'
Removed reference 'Microsoft.Practices.Unity.dll' from project 'X'
Removed package 'CommonServiceLocator.1.0.0' from 'packages.config'
...
Код: Выделить всё
...
Executing nuget actions took 5.91 sec
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot bind argument to parameter 'Path' because it is null.
Код: Выделить всё
param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath Utils.psm1)
$relativeInstallPath = Get-RelativePath ([System.Io.Path]::GetDirectoryName($dte.Solution.FullName)) $installPath
$folder = (Join-Path (Join-Path $relativeInstallPath "lib") "NET35")
Add-ToolFolder $folder
Код: Выделить всё
function Get-RelativePath([System.String] $basePath, [System.String] $targetPath)
{
# not a general purpose relative path calculation algorithm
return ($targetPath.Substring($basePath.Length)).TrimStart([System.Io.Path]::DirectorySeparatorChar)
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... ing-consum
Мобильная версия