How to specify a dependency to a remote package

Feb 23, 2011 at 12:33 PM

Hello guys.

How can I specify a dependency on a package located in a remote store? For instance, I'm building my own local packages. One of them requires nhibernate. How can i specify that in the nuspec file? I've tried this:

<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Sra.Core.Repositories</id>
<version>1.0.0.0</version>
<authors>Luis Abreu</authors>
<owners>Luis Abreu</owners>
<licenseUrl>http://www.sra.pt</licenseUrl>
<projectUrl>http://www.sra.pt</projectUrl>
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Sra core package for databse helpers. Contains code for assisting with simple ADO.NET and NH code</description>
<tags>Repository ADO.NET NH</tags>
<dependencies>
<dependency id="NHibernate" version="3.0.0.0" />
<dependency id="FluentNHibernate" version="1.0.0.0" />
<dependency id="Sra.Core" version="1.0.0.0" />
</dependencies>
</metadata>
</package>

after depoying my package, I get an error while trying to install it saying that it's unable to solve the NHIbernate package reference.

What am I doing wrong?

Developer
Feb 23, 2011 at 5:07 PM

Make sure that the repository containing NHibernate (the default NuGet feed has it) is added as a package source and you point to the package source labeled "All". This would allow NuGet to resolve the dependency.

Feb 23, 2011 at 5:20 PM

Luis,

If I am understanding you correctly, I created a work item for this issue:  http://nuget.codeplex.com/workitem/603

Does that match up with what you're having a problem with?  If so, vote it up!  :)

-Jess

Feb 24, 2011 at 8:29 AM

Yep, that's it.

not really intuitive if you ask me...