Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Assemblies with a transitive dependency to MVC are not included as part of the list of discovered assemblies #4555

Closed
@javiercn

Description

@javiercn

When an application in Assembly A references an Assembly B which in turn references an Assembly C that contains a reference to MVC, we won't include B as part of the list of discovered assemblies. For example:

MusicStore.dll references MusicStore.Data which references MusicStore.Models which in turn references Mvc, but MusicStore.Data doesn't get included in the list of discovered assemblies.

The issue is that RuntimeLibrary.Dependencies only lists direct dependencies and the filtering method that we have only looks on the list of dependencies for a reference to any of the reference MVC assemblies.

private static bool IsCandidateLibrary(RuntimeLibrary library)
{
    Debug.Assert(ReferenceAssemblies != null);
    return !ReferenceAssemblies.Contains(library.Name) &&
        library.Dependencies.Any(dependency => ReferenceAssemblies.Contains(dependency.Name));
}

project.json for MusicStore.Models

{
  "version": "1.0.0",
  "dependencies": {
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*",
    "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.0.0-*",
    "Microsoft.EntityFrameworkCore": "1.0.0-*",
    "Microsoft.Extensions.Configuration.CommandLine": "1.0.0-*",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-*",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-*",
    "NETStandard.Library": "1.5.0-rc2-24018"
}

Debug session ilustrating the failing condition

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions