You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when trying to install my own package in a new project/solution, NuGet always tries to install (some of) its dependencies using the current last stable version - despite the fact, that I have listed all dependencies in the package's nuspec with "absolute versions" - they are defined with version = "[X.X]". Also, the package includes all recursive dependencies with the matching version. The definition of the dependencies in the nuspec-file lists them even in the required order.
Here's the dependency section of my nuspec-file for "MyPackage":
By the way, I have also have tried to define the required version in the format "[X.X, X.X]" (where both "X.X" are the same), since I read in another posting that this might be helpful, but it did not make a difference in my situation.
I know that "MyPackage" is referencing quite old versions of its dependencies - a few of them (like "Prism") are also marked as deprecated on nuget.org - but my project has to use those versions, since it is part of a bigger product, that has these dependencies in those old versions, too.
"MyPackage" is available only in a "prerelease" version of "2.4.0-build9".
In addition to all that, I have installed all the above dependencies manually one-by-one using using the Package Manager Console.
If I now try to install "MyPackage", I still get the following error message (Using: Package Manager Console Host Version 3.3.0.167 [from VisualStudio 2015 Update 1]):
Install-Package : Unable to resolve dependencies. 'CommonServiceLocator 1.3.0' is not compatible with 'MyPackage 2.4.0-build9 constraint: CommonServiceLocator (= 1.3.0)', 'Prism.Composition 5.0.0 constraint: CommonServiceLocator (>= 1.2.0)'.
I am not referencing "Prism.Composition" in my nuspec-file. And also "Prism 4.1.0" does not depend on it - but "Prism 5.0.0" does. But again, I am not referencing "Prism 5.0.0" in my package and "Prism 4.1.0" is already installed and present in my project/solution.
So, why is NuGet trying to pick up a newer version of Prism and not the one installed and referenced from the package - and failing to install "MyPackage"?
It would be great, if one could point me to what I might be doing wrong or what explains this behavior.
Thanks a lot,
(Bernie).
Additional info - Dependencies of packages used in "MyPackage" as extracted from NuGet.org:
while trying to provide you with a project and packages, I found that the problem must be related to my package and dependency design - and not in how NuGet is performing its package resolution.
I cannot provide you with the real packages, since they are part of my company's production code - and with "artificial" packages and projects the problems do not occur.
So, I would like to apologize to alarm you. Although, I was spending a lot of time debugging the issues before I wrote the issue above - but maybe I was blind too deep into the story...
@boernie let me know if you find any issues with how NuGet resolves your packages.
NuGet can return very poor error messages in some scenarios where the package constraints invalid, or the packages already in the solution are not valid today. There is an issue tracking it here: #1373
Hi there,
when trying to install my own package in a new project/solution, NuGet always tries to install (some of) its dependencies using the current last stable version - despite the fact, that I have listed all dependencies in the package's nuspec with "absolute versions" - they are defined with
version = "[X.X]"
. Also, the package includes all recursive dependencies with the matching version. The definition of the dependencies in the nuspec-file lists them even in the required order.Here's the dependency section of my nuspec-file for "MyPackage":
By the way, I have also have tried to define the required version in the format "[X.X, X.X]" (where both "X.X" are the same), since I read in another posting that this might be helpful, but it did not make a difference in my situation.
I know that "MyPackage" is referencing quite old versions of its dependencies - a few of them (like "Prism") are also marked as deprecated on nuget.org - but my project has to use those versions, since it is part of a bigger product, that has these dependencies in those old versions, too.
"MyPackage" is available only in a "prerelease" version of "2.4.0-build9".
In addition to all that, I have installed all the above dependencies manually one-by-one using using the Package Manager Console.
If I now try to install "MyPackage", I still get the following error message (Using: Package Manager Console Host Version 3.3.0.167 [from VisualStudio 2015 Update 1]):
Install-Package : Unable to resolve dependencies. 'CommonServiceLocator 1.3.0' is not compatible with 'MyPackage 2.4.0-build9 constraint: CommonServiceLocator (= 1.3.0)', 'Prism.Composition 5.0.0 constraint: CommonServiceLocator (>= 1.2.0)'.
I am not referencing "Prism.Composition" in my nuspec-file. And also "Prism 4.1.0" does not depend on it - but "Prism 5.0.0" does. But again, I am not referencing "Prism 5.0.0" in my package and "Prism 4.1.0" is already installed and present in my project/solution.
So, why is NuGet trying to pick up a newer version of Prism and not the one installed and referenced from the package - and failing to install "MyPackage"?
It would be great, if one could point me to what I might be doing wrong or what explains this behavior.
Thanks a lot,
(Bernie).
Additional info - Dependencies of packages used in "MyPackage" as extracted from NuGet.org:
CommonServiceLocator 1.3:
Unity 2.1.505 (and 2.1.505.2):
Unity.Interception 2.1.505 (and 2.1.505.2):
EnterpriseLibrary.Common 5.0.505:
EnterpriseLibrary.ExceptionHandling 5.0.505:
EnterpriseLibrary.Logging 5.0.505 (and 5.0.505.1):
EnterpriseLibrary.ExceptionHandling.Logging 5.0.505:
EnterpriseLibrary.Security.Cryptography 5.0.505:
Prism 4.1.0:
Prism.UnityExtensions 4.1.0:
Additional info - Dependencies of "Prism 5.0.0 (deprecated)" package:
Prism 5.0.0:
Additional info - Already installed packages in my project/solution (directories under solution's "packages" folder):
The text was updated successfully, but these errors were encountered: