From 498c1c570d3fa710dac295368257e03926e0c9c4 Mon Sep 17 00:00:00 2001 From: martincostello Date: Thu, 23 Feb 2017 20:25:14 +0000 Subject: [PATCH] Update error message Update error message based on PR feedback to less C# specific. --- .../Internal/DefaultRoslynCompilationService.cs | 4 ++-- .../Properties/Resources.Designer.cs | 4 ++-- src/Microsoft.AspNetCore.Mvc.Razor/Resources.resx | 2 +- .../ErrorPageTests.cs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRoslynCompilationService.cs b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRoslynCompilationService.cs index 0240fa5ca4..af09864471 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRoslynCompilationService.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRoslynCompilationService.cs @@ -151,8 +151,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal string.Equals(CS0246, g.Id, StringComparison.OrdinalIgnoreCase))) { additionalMessage = Resources.FormatCompilation_DependencyContextIsNotSpecified( - "PreserveCompilationContext", - "csproj"); + "Microsoft.NET.Sdk.Web", + "PreserveCompilationContext"); } var compilationFailure = new CompilationFailure( diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Properties/Resources.Designer.cs b/src/Microsoft.AspNetCore.Mvc.Razor/Properties/Resources.Designer.cs index bae652341d..b036a6d5bd 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Properties/Resources.Designer.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Properties/Resources.Designer.cs @@ -447,7 +447,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor } /// - /// One or more compilation references are missing. Possible causes include a missing '{0}' property in the application's '{1}' file. + /// One or more compilation references are missing. Ensure that your project is referencing '{0}' and the '{1}' property is not set to false. /// internal static string Compilation_DependencyContextIsNotSpecified { @@ -455,7 +455,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor } /// - /// One or more compilation references are missing. Possible causes include a missing '{0}' property in the application's '{1}' file. + /// One or more compilation references are missing. Ensure that your project is referencing '{0}' and the '{1}' property is not set to false. /// internal static string FormatCompilation_DependencyContextIsNotSpecified(object p0, object p1) { diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Resources.resx b/src/Microsoft.AspNetCore.Mvc.Razor/Resources.resx index 6a15e01830..44bc4d7d75 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Resources.resx +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Resources.resx @@ -201,7 +201,7 @@ A circular layout reference was detected when rendering '{0}'. The layout page '{1}' has already been rendered. - One or more compilation references are missing. Possible causes include a missing '{0}' property in the application's '{1}' file. + One or more compilation references are missing. Ensure that your project is referencing '{0}' and the '{1}' property is not set to false. '{0}' cannot be empty. These locations are required to locate a view for rendering. diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ErrorPageTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ErrorPageTests.cs index 70b545766b..1bc3396f80 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ErrorPageTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ErrorPageTests.cs @@ -17,8 +17,8 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests public class ErrorPageTests : IClassFixture> { private static readonly string PreserveCompilationContextMessage = HtmlEncoder.Default.Encode( - "One or more compilation references are missing. Possible causes include a missing " + - "'PreserveCompilationContext' property in the application's 'csproj' file."); + "One or more compilation references are missing. Ensure that your project is referencing " + + "'Microsoft.NET.Sdk.Web' and the 'PreserveCompilationContext' property is not set to false."); public ErrorPageTests(MvcTestFixture fixture) { Client = fixture.Client;