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.
MVC ignores precompiled views where it cannot find the source file #2462
Closed
Description
CompilerCache.cs: line 115-124
// For precompiled views, the first time the entry is read, we need to ensure that no changes were made
// either to the file associated with this entry, or any _GlobalImport associated with it between the time
// the View was precompiled and the time EnsureInitialized was called. For later iterations, we can
// rely on expiration triggers ensuring the validity of the entry.
var fileInfo = _fileProvider.GetFileInfo(relativePath);
if (!fileInfo.Exists)
{
return null;
}
As can be seen, if the original source file of a precompiled razor view does not exist (or is not found), it ignores it.