Fixed netcore50 package based frameworks (#2630)
This commit is contained in:
parent
3d8cbba932
commit
c8fb6c26c3
4 changed files with 29 additions and 2 deletions
|
@ -8,6 +8,11 @@
|
||||||
"Microsoft.NETCore.App": "1.0.0-rc2-*"
|
"Microsoft.NETCore.App": "1.0.0-rc2-*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"netcore50": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.Private.Uri": "4.0.1-rc2-24018"
|
||||||
|
}
|
||||||
|
},
|
||||||
"net99": {
|
"net99": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.CSharp": "4.0.1-rc2-24018"
|
"Microsoft.CSharp": "4.0.1-rc2-24018"
|
||||||
|
|
|
@ -380,7 +380,7 @@ namespace Microsoft.DotNet.ProjectModel
|
||||||
if (package != null &&
|
if (package != null &&
|
||||||
package.Resolved &&
|
package.Resolved &&
|
||||||
package.HasCompileTimePlaceholder &&
|
package.HasCompileTimePlaceholder &&
|
||||||
!TargetFramework.IsPackageBased)
|
!TargetFramework.IsPackageBased())
|
||||||
{
|
{
|
||||||
var newKey = new LibraryKey(library.Identity.Name, LibraryType.ReferenceAssembly);
|
var newKey = new LibraryKey(library.Identity.Name, LibraryType.ReferenceAssembly);
|
||||||
var dependency = new LibraryRange(library.Identity.Name, LibraryType.ReferenceAssembly);
|
var dependency = new LibraryRange(library.Identity.Name, LibraryType.ReferenceAssembly);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
using System.Linq;
|
using System;
|
||||||
using System.Runtime.Versioning;
|
using System.Runtime.Versioning;
|
||||||
|
|
||||||
namespace NuGet.Frameworks
|
namespace NuGet.Frameworks
|
||||||
|
@ -56,5 +56,12 @@ namespace NuGet.Frameworks
|
||||||
}
|
}
|
||||||
return name + "-" + frameworkName.Profile;
|
return name + "-" + frameworkName.Profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsPackageBased(this NuGetFramework self)
|
||||||
|
{
|
||||||
|
return self.IsPackageBased ||
|
||||||
|
(self.Framework == FrameworkConstants.FrameworkIdentifiers.NetCore &&
|
||||||
|
self.Version >= new Version(5, 0, 0, 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,22 @@ namespace Microsoft.DotNet.ProjectModel.Tests
|
||||||
.WithTargetFramework("net99")
|
.WithTargetFramework("net99")
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
// Will fail with dupes if any
|
||||||
context.LibraryManager.GetLibraries().ToDictionary(l => l.Identity.Name);
|
context.LibraryManager.GetLibraries().ToDictionary(l => l.Identity.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void NetCore50ShouldNotResolveFrameworkAssemblies()
|
||||||
|
{
|
||||||
|
var instance = TestAssetsManager.CreateTestInstance("TestMicrosoftCSharpReferenceMissingFramework")
|
||||||
|
.WithLockFiles();
|
||||||
|
|
||||||
|
var context = new ProjectContextBuilder().WithProjectDirectory(instance.TestRoot)
|
||||||
|
.WithTargetFramework("netcore50")
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var diagnostics = context.LibraryManager.GetAllDiagnostics();
|
||||||
|
Assert.False(diagnostics.Any(d => d.ErrorCode == ErrorCodes.DOTNET1011));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue