This repository was archived by the owner on Dec 14, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/Microsoft.AspNetCore.Mvc.Razor/Compilation Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -15,19 +15,15 @@ public static class CompiledViewManfiest
15
15
16
16
public static Type GetManifestType ( AssemblyPart assemblyPart , string typeName )
17
17
{
18
- EnsureFeatureAssembly ( assemblyPart ) ;
19
-
20
- var precompiledAssemblyName = new AssemblyName ( assemblyPart . Assembly . FullName ) ;
21
- precompiledAssemblyName . Name = precompiledAssemblyName . Name + PrecompiledViewsAssemblySuffix ;
22
-
23
- return Type . GetType ( $ "{ typeName } ,{ precompiledAssemblyName } ") ;
18
+ var assembly = GetFeatureAssembly ( assemblyPart ) ;
19
+ return assembly ? . GetType ( typeName ) ;
24
20
}
25
21
26
- private static void EnsureFeatureAssembly ( AssemblyPart assemblyPart )
22
+ private static Assembly GetFeatureAssembly ( AssemblyPart assemblyPart )
27
23
{
28
24
if ( assemblyPart . Assembly . IsDynamic || string . IsNullOrEmpty ( assemblyPart . Assembly . Location ) )
29
25
{
30
- return ;
26
+ return null ;
31
27
}
32
28
33
29
var precompiledAssemblyFileName = assemblyPart . Assembly . GetName ( ) . Name
@@ -41,13 +37,15 @@ private static void EnsureFeatureAssembly(AssemblyPart assemblyPart)
41
37
{
42
38
try
43
39
{
44
- Assembly . LoadFile ( precompiledAssemblyFilePath ) ;
40
+ return Assembly . LoadFile ( precompiledAssemblyFilePath ) ;
45
41
}
46
42
catch ( FileLoadException )
47
43
{
48
44
// Don't throw if assembly cannot be loaded. This can happen if the file is not a managed assembly.
49
45
}
50
46
}
47
+
48
+ return null ;
51
49
}
52
50
}
53
51
}
You can’t perform that action at this time.
0 commit comments