parent
dfbf6d43ff
commit
c8a1bb6914
|
|
@ -16,20 +16,20 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
{
|
{
|
||||||
internal static HashSet<string> ReferenceAssemblies { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
internal static HashSet<string> ReferenceAssemblies { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
"microsoft.aspnetcore.mvc",
|
"Microsoft.AspNetCore.Mvc",
|
||||||
"microsoft.aspnetcore.mvc.abstractions",
|
"Microsoft.AspNetCore.Mvc.Abstractions",
|
||||||
"microsoft.aspnetcore.mvc.apiexplorer",
|
"Microsoft.AspNetCore.Mvc.ApiExplorer",
|
||||||
"microsoft.aspnetcore.mvc.core",
|
"Microsoft.AspNetCore.Mvc.Core",
|
||||||
"microsoft.aspnetcore.mvc.cors",
|
"Microsoft.AspNetCore.Mvc.Cors",
|
||||||
"microsoft.aspnetcore.mvc.dataannotations",
|
"Microsoft.AspNetCore.Mvc.DataAnnotations",
|
||||||
"microsoft.aspnetcore.mvc.formatters.json",
|
"Microsoft.AspNetCore.Mvc.Formatters.Json",
|
||||||
"microsoft.aspnetcore.mvc.formatters.xml",
|
"Microsoft.AspNetCore.Mvc.Formatters.Xml",
|
||||||
"microsoft.aspnetcore.mvc.localization",
|
"Microsoft.AspNetCore.Mvc.Localization",
|
||||||
"microsoft.aspnetcore.mvc.razor",
|
"Microsoft.AspNetCore.Mvc.Razor",
|
||||||
"microsoft.aspnetcore.mvc.razor.extensions",
|
"Microsoft.AspNetCore.Mvc.Razor.Extensions",
|
||||||
"microsoft.aspnetcore.mvc.razorpages",
|
"Microsoft.AspNetCore.Mvc.RazorPages",
|
||||||
"microsoft.aspnetcore.mvc.taghelpers",
|
"Microsoft.AspNetCore.Mvc.TagHelpers",
|
||||||
"microsoft.aspnetcore.mvc.viewfeatures"
|
"Microsoft.AspNetCore.Mvc.ViewFeatures"
|
||||||
};
|
};
|
||||||
|
|
||||||
public static IEnumerable<ApplicationPart> DiscoverAssemblyParts(string entryPointAssemblyName)
|
public static IEnumerable<ApplicationPart> DiscoverAssemblyParts(string entryPointAssemblyName)
|
||||||
|
|
|
||||||
|
|
@ -229,30 +229,31 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
// This test verifies DefaultAssemblyPartDiscoveryProvider.ReferenceAssemblies reflects the actual loadable assemblies
|
// This test verifies DefaultAssemblyPartDiscoveryProvider.ReferenceAssemblies reflects the actual loadable assemblies
|
||||||
// of the libraries that Microsoft.AspNetCore.Mvc dependes on.
|
// of the libraries that Microsoft.AspNetCore.Mvc dependes on.
|
||||||
// If we add or remove dependencies, this test should be changed together.
|
// If we add or remove dependencies, this test should be changed together.
|
||||||
[Fact(Skip = "https://github.com/aspnet/Mvc/issues/6122")]
|
[Fact]
|
||||||
public void ReferenceAssemblies_ReturnsLoadableReferenceAssemblies()
|
public void ReferenceAssemblies_ReturnsLoadableReferenceAssemblies()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var excludeAssemblies = new string[]
|
var excludeAssemblies = new string[]
|
||||||
{
|
{
|
||||||
"microsoft.aspnetcore.mvc.core.test",
|
"Microsoft.AspNetCore.Mvc.Core.Test",
|
||||||
"microsoft.aspnetcore.mvc.testcommon",
|
"Microsoft.AspNetCore.Mvc.TestCommon",
|
||||||
"microsoft.aspnetcore.mvc.testdiagnosticlistener",
|
"Microsoft.AspNetCore.Mvc.TestDiagnosticListener",
|
||||||
"microsoft.aspnetcore.mvc.webapicompatshim",
|
"Microsoft.AspNetCore.Mvc.WebApiCompatShim",
|
||||||
};
|
};
|
||||||
|
|
||||||
var additionalAssemblies = new[]
|
var additionalAssemblies = new[]
|
||||||
{
|
{
|
||||||
// The following assemblies are not reachable from Microsoft.AspNetCore.Mvc
|
// The following assemblies are not reachable from Microsoft.AspNetCore.Mvc
|
||||||
"microsoft.aspnetcore.mvc.taghelpers",
|
"Microsoft.AspNetCore.Mvc.Formatters.Xml",
|
||||||
"microsoft.aspnetcore.mvc.formatters.xml",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var expected = DependencyContext.Load(CurrentAssembly)
|
var dependencyContextLibraries = DependencyContext.Load(CurrentAssembly)
|
||||||
.RuntimeLibraries
|
.RuntimeLibraries
|
||||||
.Where(r => r.Name.StartsWith("microsoft.aspnetcore.mvc", StringComparison.Ordinal) &&
|
.Where(r => r.Name.StartsWith("Microsoft.AspNetCore.Mvc", StringComparison.Ordinal) &&
|
||||||
!excludeAssemblies.Contains(r.Name, StringComparer.OrdinalIgnoreCase))
|
!excludeAssemblies.Contains(r.Name, StringComparer.OrdinalIgnoreCase))
|
||||||
.Select(r => r.Name)
|
.Select(r => r.Name);
|
||||||
|
|
||||||
|
var expected = dependencyContextLibraries
|
||||||
.Concat(additionalAssemblies)
|
.Concat(additionalAssemblies)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.OrderBy(p => p, StringComparer.Ordinal);
|
.OrderBy(p => p, StringComparer.Ordinal);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue