React to the deprecation of Microsoft.AspNetCore.All (aspnet/Mvc#8751)

This commit is contained in:
Nate McMaster 2018-11-20 17:36:47 -08:00 committed by GitHub
parent 1521f9298b
commit bfdecc8f5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -14,10 +14,10 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts
{
internal static HashSet<string> ReferenceAssemblies { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
// The deps file for the Microsoft.AspNetCore.All shared runtime is authored in a way where it does not say
// The deps file for the Microsoft.AspNetCore.App shared runtime is authored in a way where it does not say
// it depends on Microsoft.AspNetCore.Mvc even though it does. Explicitly list it so that referencing this runtime causes
// assembly discovery to work correctly.
"Microsoft.AspNetCore.All",
"Microsoft.AspNetCore.App",
"Microsoft.AspNetCore.Mvc",
"Microsoft.AspNetCore.Mvc.Abstractions",
"Microsoft.AspNetCore.Mvc.ApiExplorer",
@ -154,7 +154,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts
// Internal for unit testing
internal static IEnumerable<RuntimeLibrary> GetCandidateLibraries(DependencyContext dependencyContext)
{
// When using Microsoft.AspNetCore.App \ Microsoft.AspNetCore.All shared runtimes, entries in the RuntimeLibraries
// When using the Microsoft.AspNetCore.App shared runtimes, entries in the RuntimeLibraries
// get "erased" and it is no longer accurate to query to determine a library's dependency closure.
// We'll use CompileLibraries to calculate the dependency graph and runtime library to resolve assemblies to inspect.
var candidatesResolver = new CandidateResolver(dependencyContext.CompileLibraries, ReferenceAssemblies);

View File

@ -35,8 +35,8 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts
// Arrange
var runtimeLibraries = new[]
{
GetRuntimeLibrary("MyApp", "Microsoft.AspNetCore.All"),
GetRuntimeLibrary("Microsoft.AspNetCore.All", "Microsoft.NETCore.App"),
GetRuntimeLibrary("MyApp", "Microsoft.AspNetCore.App"),
GetRuntimeLibrary("Microsoft.AspNetCore.App", "Microsoft.NETCore.App"),
GetRuntimeLibrary("Microsoft.NETCore.App"),
GetRuntimeLibrary("ClassLibrary"),
};
@ -257,22 +257,22 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts
public void GetCandidateLibraries_ReturnsRuntimeLibraries_IfCompileLibraryDependencyToMvcIsPresent()
{
// Arrange
// When an app is running against Microsoft.AspNetCore.All shared runtime or if the DependencyContext is queried
// When an app is running against Microsoft.AspNetCore.App shared runtime or if the DependencyContext is queried
// from an app that's running on Microsoft.NETCore.App (e.g. in a unit testing scenario), the
// runtime library does not state that the app references Mvc whereas the compile library does. This test validates
// that we correctly recognize this scenario.
var expected = GetRuntimeLibrary("MyApp", "Microsoft.AspNetCore.All");
var expected = GetRuntimeLibrary("MyApp", "Microsoft.AspNetCore.App");
var runtimeLibraries = new[]
{
expected,
GetRuntimeLibrary("Microsoft.AspNetCore.All", "Microsoft.NETCore.App"),
GetRuntimeLibrary("Microsoft.AspNetCore.App", "Microsoft.NETCore.App"),
GetRuntimeLibrary("Microsoft.NETCore.App"),
};
var compileLibraries = new[]
{
GetCompileLibrary("MyApp", "Microsoft.AspNetCore.All"),
GetCompileLibrary("Microsoft.AspNetCore.All", "Microsoft.AspNetCore.Mvc", "Microsoft.NETCore.App"),
GetCompileLibrary("MyApp", "Microsoft.AspNetCore.App"),
GetCompileLibrary("Microsoft.AspNetCore.App", "Microsoft.AspNetCore.Mvc", "Microsoft.NETCore.App"),
GetCompileLibrary("Microsoft.AspNetCore.Mvc"),
GetCompileLibrary("Microsoft.NETCore.App"),
};

View File

@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts
var additionalAssemblies = new[]
{
// The following assemblies are not reachable from Microsoft.AspNetCore.Mvc
"Microsoft.AspNetCore.All",
"Microsoft.AspNetCore.App",
"Microsoft.AspNetCore.Mvc.Formatters.Xml",
};