diff --git a/src/Core/PackageWalker/PackageWalker.cs b/src/Core/PackageWalker/PackageWalker.cs index 625210ad1..05f4f490c 100644 --- a/src/Core/PackageWalker/PackageWalker.cs +++ b/src/Core/PackageWalker/PackageWalker.cs @@ -198,6 +198,7 @@ private void ProcessPackageTarget(IPackage package) Debug.Assert(parentInfo != null); + if (parentInfo.InitialTarget == PackageTargets.None) { // Update the parent target type @@ -205,17 +206,18 @@ private void ProcessPackageTarget(IPackage package) // If we ended up with both that means we found a dependency only packages // that has a mix of solution and project level packages - if (parentInfo.Target == PackageTargets.All) - { - throw new InvalidOperationException(NuGetResources.DependencyOnlyCannotMixDependencies); - } - } - - // Solution packages can't depend on project level packages - if (parentInfo.Target == PackageTargets.External && info.Target.HasFlag(PackageTargets.Project)) - { - throw new InvalidOperationException(NuGetResources.ExternalPackagesCannotDependOnProjectLevelPackages); + //if (parentInfo.Target == PackageTargets.All) + //{ + // throw new InvalidOperationException(NuGetResources.DependencyOnlyCannotMixDependencies); + //} } + // Choco doesn't care about this at all + + //// Solution packages can't depend on project level packages + //if (parentInfo.Target == PackageTargets.External && info.Target.HasFlag(PackageTargets.Project)) + //{ + // throw new InvalidOperationException(NuGetResources.ExternalPackagesCannotDependOnProjectLevelPackages); + //} } } diff --git a/test/Core.Test/PackageWalkerTest.cs b/test/Core.Test/PackageWalkerTest.cs index e6eb16f0a..6b6978513 100644 --- a/test/Core.Test/PackageWalkerTest.cs +++ b/test/Core.Test/PackageWalkerTest.cs @@ -1055,7 +1055,7 @@ public void AfterPackageWalkSatellitePackageIsClassifiedTheSameAsDependencies() Assert.Equal(PackageTargets.Project, walker.GetPackageInfo(satellitePackage).Target); } - [Fact] + //[Fact] public void MetaPackageWithMixedTargetsThrows() { // Arrange @@ -1078,7 +1078,8 @@ public void MetaPackageWithMixedTargetsThrows() ExceptionAssert.Throws(() => walker.Walk(metaPackage), "Child dependencies of dependency only packages cannot mix external and project packages."); } - [Fact] + + //[Fact] public void ExternalPackagesThatDepdendOnProjectLevelPackagesThrows() { // Arrange diff --git a/test/Core.Test/ProjectManagerTest.cs b/test/Core.Test/ProjectManagerTest.cs index 5e34b1f92..37322c47e 100644 --- a/test/Core.Test/ProjectManagerTest.cs +++ b/test/Core.Test/ProjectManagerTest.cs @@ -2809,7 +2809,7 @@ public void AddPackageReferenceAllowsAddingMetadataPackage() Assert.True(localRepository.Exists("B")); } - [Fact] + //[Fact] public void AddPackageReferenceDoesNotAllowAddingDependencyPackageWhichHasToolsFiles() { // Arrange