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

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

Closed
nathannau opened this issue Jan 11, 2017 · 2 comments
Assignees

Comments

@nathannau
Copy link

nathannau commented Jan 11, 2017

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

@pranavkm
Copy link
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.

@Eilon Eilon added this to the 2.0.0 milestone Jan 11, 2017
@Eilon
Copy link
Member

Eilon commented Jan 11, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants