I have my nuget package, lets call it A that has a dependency on another public package Nunit.Runners
When A depends on Nunit.Runners it doesn't add the assemblies I need into my project, the assemblies I depend on are in NUnit.Runners.2.6.3\tools\lib so, because nuget only adds referces to assemblies in lib, I think I need to add a Install.ps1 to my nuget package
I now have
param($installPath, $toolsPath, $package, $project)
$NunitRunners = join-path -path $packagesFolder -childpath "NUnit.Runners.2.6.3"
$project.Object.References.Add($NunitRunners+"\nunit.core")
$project.Object.References.Add($NunitRunners+"\nunit.core.interfaces")
But it's throwing
Exception calling "Add" with "1" argument(s): "Unspecified error
(Exception from HRESULT: 0x80004005 (E_FAIL))" At
+ $project.Object.References.Add <<<< ($NunitRunners+"nunit.core.dll")
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
Any pointers as to why this is throwing on "Add" super welcome
My install.ps1 (here for reference)
param($installPath, $toolsPath, $package, $project)
write-host "Install path" $installPath
$packagesFolder = Split-Path -Path $installPath -Parent
write-host "packages folder" $packagesFolder
write-host $toolsPath
write-host $package
$NunitRunners = join-path -path $packagesFolder -childpath "NUnit.Runners.2.6.3"
write-host $NunitRunners
$project.Object.References.Add($NunitRunners+"\nunit.core")
$project.Object.References.Add($NunitRunners+"\nunit.core.interfaces")
BTW I just need to reference those two assemblies, I don't need to reference nunit.framework
NOTE: I did see this thread in codeplex but nothing there pointed to a solution (ie the project is not client profile and the assemblies shouldn't be on the GAC)