Don't fail precompiled view discovery if assembly is not managed
This commit is contained in:
parent
d09e921c4a
commit
4a1c437f60
|
|
@ -69,7 +69,14 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Compilation
|
|||
|
||||
if (File.Exists(precompiledAssemblyFilePath))
|
||||
{
|
||||
System.Runtime.Loader.AssemblyLoadContext.Default.LoadFromAssemblyPath(precompiledAssemblyFilePath);
|
||||
try
|
||||
{
|
||||
System.Runtime.Loader.AssemblyLoadContext.Default.LoadFromAssemblyPath(precompiledAssemblyFilePath);
|
||||
}
|
||||
catch (FileLoadException)
|
||||
{
|
||||
// Don't throw if assembly cannot be loaded. This can happen if the file is not a managed assembly.
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue