diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs index 96f7e40c7c..9e773e1c42 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs @@ -85,12 +85,13 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives public void MergeInheritedChunks(List inherited) { var current = CodeTree.Chunks; + IChunkMerger merger; // We merge chunks into the codeTree in two passes. In the first pass, we traverse the CodeTree visiting // a mapped IChunkMerger for types that are registered. foreach (var chunk in current) { - if (ChunkMergers.TryGetValue(chunk.GetType(), out var merger)) + if (ChunkMergers.TryGetValue(chunk.GetType(), out merger)) { merger.VisitChunk(chunk); } @@ -101,7 +102,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives // rules. foreach (var chunk in inherited) { - if (ChunkMergers.TryGetValue(chunk.GetType(), out var merger)) + if (ChunkMergers.TryGetValue(chunk.GetType(), out merger)) { // TODO: When mapping chunks, we should remove mapping information since it would be incorrect // to generate it in the page that inherits it. Tracked by #945 diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs index 70bc97e407..bd19a929b0 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs @@ -66,7 +66,8 @@ namespace Microsoft.AspNet.Mvc.Razor public CompilationResult GetOrAdd(RelativeFileInfo fileInfo, Func compile) { - if (!_cache.TryGetValue(fileInfo.RelativePath, out var cacheEntry)) + CompilerCacheEntry cacheEntry; + if (!_cache.TryGetValue(fileInfo.RelativePath, out cacheEntry)) { return OnCacheMiss(fileInfo, compile); }