diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilationResult.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilationResult.cs index 7fbcac81b2..7c520db3ad 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilationResult.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilationResult.cs @@ -39,18 +39,6 @@ namespace Microsoft.AspNet.Mvc.Razor /// public IEnumerable Messages { get; private set; } - /// - /// Gets additional information from compilation. - /// - /// - /// In the event of a compilation failure, values from this dictionary are copied to the - /// property of the thrown. - /// - public IDictionary AdditionalInfo - { - get; private set; - } - /// /// Gets the generated C# content that was compiled. /// @@ -81,19 +69,16 @@ namespace Microsoft.AspNet.Mvc.Razor /// The for the Razor file that was compiled. /// The generated C# content to be compiled. /// The sequence of failure messages encountered during compilation. - /// Additional info about the compilation. /// A CompilationResult instance representing a failure. public static CompilationResult Failed([NotNull] IFileInfo file, [NotNull] string compilationContent, - [NotNull] IEnumerable messages, - IDictionary additionalInfo) + [NotNull] IEnumerable messages) { return new CompilationResult { File = file, CompiledContent = compilationContent, Messages = messages, - AdditionalInfo = additionalInfo }; } @@ -113,16 +98,7 @@ namespace Microsoft.AspNet.Mvc.Razor private CompilationFailedException CreateCompilationFailedException() { var fileContent = ReadContent(File); - var exception = new CompilationFailedException(FilePath, fileContent, CompiledContent, Messages); - if (AdditionalInfo != null) - { - foreach (var item in AdditionalInfo) - { - exception.Data.Add(item.Key, item.Value); - } - } - - return exception; + return new CompilationFailedException(FilePath, fileContent, CompiledContent, Messages); } private static string ReadContent(IFileInfo file) diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs index e176f9afd3..50d134bc8b 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs @@ -22,7 +22,6 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation /// public class RoslynCompilationService : ICompilationService { - public static readonly string CompilationResultDiagnosticsKey = "Diagnostics"; private static readonly ConcurrentDictionary _metadataFileCache = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); @@ -85,11 +84,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation .Select(d => GetCompilationMessage(formatter, d)) .ToList(); - var additionalInfo = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - { CompilationResultDiagnosticsKey, result.Diagnostics } - }; - return CompilationResult.Failed(fileInfo, compilationContent, messages, additionalInfo); + return CompilationResult.Failed(fileInfo, compilationContent, messages); } Assembly assembly; diff --git a/src/Microsoft.AspNet.Mvc.Razor/Razor/RazorCompilationService.cs b/src/Microsoft.AspNet.Mvc.Razor/Razor/RazorCompilationService.cs index 20945a83e8..9775e34e1e 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Razor/RazorCompilationService.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Razor/RazorCompilationService.cs @@ -49,7 +49,7 @@ namespace Microsoft.AspNet.Mvc.Razor if (!results.Success) { var messages = results.ParserErrors.Select(e => new CompilationMessage(e.Message)); - return CompilationResult.Failed(file, results.GeneratedCode, messages, additionalInfo: null); + return CompilationResult.Failed(file, results.GeneratedCode, messages); } return _baseCompilationService.Compile(file, results.GeneratedCode); diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/CompilationResultTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/CompilationResultTest.cs index 94a75ca5be..675a3dfec5 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/CompilationResultTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/CompilationResultTest.cs @@ -38,8 +38,7 @@ world"; }; var result = CompilationResult.Failed(fileInfo.Object, "

hello world

", - messages, - additionalInfo); + messages); // Act and Assert var ex = Assert.Throws(() => result.CompiledType);