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

@nathannau

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))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions