diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/CompilationFailedExceptionFactory.cs b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/CompilationFailedExceptionFactory.cs index e529a035f7..0be6fa6b7d 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/CompilationFailedExceptionFactory.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/CompilationFailedExceptionFactory.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal { // If a SourceLocation does not specify a file path, assume it is produced from parsing the current file. var messageGroups = diagnostics.GroupBy( - razorError => razorError.Span.FilePath ?? codeDocument.Source.FileName, + razorError => razorError.Span.FilePath ?? codeDocument.Source.FilePath, StringComparer.Ordinal); var failures = new List(); @@ -98,13 +98,13 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal private static string ReadContent(RazorCodeDocument codeDocument, string filePath) { RazorSourceDocument sourceDocument; - if (string.IsNullOrEmpty(filePath) || string.Equals(codeDocument.Source.FileName, filePath, StringComparison.Ordinal)) + if (string.IsNullOrEmpty(filePath) || string.Equals(codeDocument.Source.FilePath, filePath, StringComparison.Ordinal)) { sourceDocument = codeDocument.Source; } else { - sourceDocument = codeDocument.Imports.FirstOrDefault(f => string.Equals(f.FileName, filePath, StringComparison.Ordinal)); + sourceDocument = codeDocument.Imports.FirstOrDefault(f => string.Equals(f.FilePath, filePath, StringComparison.Ordinal)); } if (sourceDocument != null) @@ -150,7 +150,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal { if (diagnostic.Location == Location.None) { - return codeDocument.Source.FileName; + return codeDocument.Source.FilePath; } return diagnostic.Location.GetMappedLineSpan().Path; diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorViewCompiler.cs b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorViewCompiler.cs index 575c7f6bc8..e5412f5aae 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorViewCompiler.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorViewCompiler.cs @@ -231,7 +231,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal internal Assembly CompileAndEmit(RazorCodeDocument codeDocument, string generatedCode) { - _logger.GeneratedCodeToAssemblyCompilationStart(codeDocument.Source.FileName); + _logger.GeneratedCodeToAssemblyCompilationStart(codeDocument.Source.FilePath); var startTimestamp = _logger.IsEnabled(LogLevel.Debug) ? Stopwatch.GetTimestamp() : 0; @@ -259,7 +259,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal pdbStream.Seek(0, SeekOrigin.Begin); var assembly = Assembly.Load(assemblyStream.ToArray(), pdbStream.ToArray()); - _logger.GeneratedCodeToAssemblyCompilationEnd(codeDocument.Source.FileName, startTimestamp); + _logger.GeneratedCodeToAssemblyCompilationEnd(codeDocument.Source.FilePath, startTimestamp); return assembly; }