Unable to resolve dependency

Feb 21, 2011 at 9:18 PM

I installed and started using NuGet 1.1 this weekend and ran into a couple of issues. I initially created a project to use as a playground and added NHibernate 3.0, which successfully installed NHibernate A little later I installed ConfOrm in the same project and ran into a really nice DLL hell scenario given that the NHiber assembly is signed and ConfOrm has a strong-named reference to NHibernate I was finally able to hook into the assembly load event and redirect any attempt to load any version of NHibernate to use the already loaded instance to work around the problem. I don't imagine there's much NuGet can do about this one, though.

A little later I added a unit test project to the solution and attempted to add a reference to ConfOrm, NHibernate, or anything that references NHibernate 3.0 and I keep getting this error:

Unable to resolve dependency 'Iesi.Collections (≥ 1.0.1)'.

Iesi.Collections 1.0.1 is listed in the available packages, so I installed it manually then tried to install ConfOrm or NHibernate 3 again and it can't resolve Antlr I was finally able to install ConForm after installing both Iesi.Collections and Antlr manually (e.g. search for Iesi.Collections, click install, search for Antlr, click install).

Today I deleted the folder containing the test projects and created a new solution, but I'm still having the same problem for some reason. I have to manually install Iesi.Collections and Antlr because NuGet claims it can't resolve these dependencies.

Feb 21, 2011 at 9:29 PM
Edited Feb 21, 2011 at 9:36 PM

Actually, NuGet can very much help with the strong name not matching. :) You just need to run 'add-bindingredirect', and that should make everything run (see my post for details). We'll later make this more automatic.

However, I'm not sure about the second issue you report. Is that consisitently reproducible? Could you give exact step by step instructions starting from an empty solution until you hit that condition?


Feb 23, 2011 at 4:19 AM

Thanks for the information. I'll keep add-bindingredirect handy to resolve this in the future.

The issue with Iesi.Collections and Antlr is consistently reproducible. All I have to do is run Visual Studio 2010, create a new ASP.NET web application, add a new class library for the domain classes, and add a new class library for the repository/DAO/persistence classes. I usually name the three projects something like WebApplication1, Something.Domain,and Something.Repository. Then in the Repository project, I right click references, select Add Library Package Reference, pick say ConfOrm or NHibernate, and it immediately complains it can't find Iesi.Collection >= 1.0.1. What's really weird is that it worked like a charm the very first time I added a reference to NHibernate, but it has consistently failed on every attempt since then. I can manually add Iesi.Collection and it will complain that it can't resolve Antlr. If I manually install Antlr, it works like a charm.

Feb 23, 2011 at 4:36 AM

Hmmm, I was just able to repro, but only if I use the Recent Packages tab instead of the Online tab. Is that what you are doing too?

Feb 23, 2011 at 4:40 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 23, 2011 at 6:22 AM

Relevant bug is actually http://nuget.codeplex.com/workitem/619

Feb 26, 2011 at 4:33 AM

Yes, I initially attempted to install ConfOrm/NHibernate from the Recent Packages tab. After that failed, I also attempted to install from online searches but I wonder if it was still trying to pick it up from recent packages anyway since I probably never closed the dialog between attempts. I cleared the recent packages list and it started working again.