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.

NullException in Microsoft.AspNetCore.Mvc.Razor.Compilation.ViewsFeatureProvider.GetViewInfoContainerType #5675

Closed

Description

@nathannau

When you load assembly from stream, Assembly.IsDynamic = false and Assembly.Location is empty (not null) so Path.GetDirectoryName(assemblyPart.Assembly.Location) return null...

So :
in file Mvc/src/Microsoft.AspNetCore.Mvc.Razor/Compilation/ViewsFeatureProvider.cs line 61
if (!assemblyPart.Assembly.IsDynamic && assemblyPart.Assembly.Location != null)
must be :
if (!assemblyPart.Assembly.IsDynamic && !string.IsNullOrEmpty(assemblyPart.Assembly.Location))

Activity

  1. pranavkm commented on Jan 11, 2017

    @pranavkm
    Contributor

    Would you like to send a PR for this? Here's the PR for the earlier change that added the IsDynamic check: 24d5dfb in case you'd like to use a reference.

  2. added this to the 2.0.0 milestone on Jan 11, 2017
  3. Eilon commented on Jan 11, 2017

    @Eilon
    Contributor

    @pranavkm feel free to fix or wait for a PR. And add a test, if possible!

  4. added a commit that references this issue on Jan 13, 2017
    1efc7b5
  5. added 2 commits that reference this issue on Jan 13, 2017
    884daee
    4d969ea
  6. added a commit that references this issue on Jan 17, 2017
    e749a80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions