From 5424045dac3a9b8e4f89fa9b83d505fd1185745d Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 11 Apr 2019 17:14:11 -0700 Subject: [PATCH 1/5] Ensure PackageArchive contains the right build of Razor.Design package (#6992) * Ensure PackageArchive contains the right build of Razor.Design package * Re-order values in build\dependencies.props to ensure Razor.Design's package version is overwritten. * Convert additional package refs to project refs Fixes https://github.com/aspnet/AspNetCore-Internal/issues/1708 * Update CodeCheck.ps1 --- build/dependencies.props | 8 -------- eng/scripts/CodeCheck.ps1 | 2 +- .../src/Microsoft.AspNetCore.Mvc.Razor.csproj | 20 +++---------------- ...Microsoft.AspNetCore.Mvc.TagHelpers.csproj | 2 +- .../Mvc/src/Microsoft.AspNetCore.Mvc.csproj | 8 ++------ src/Mvc/samples/MvcSandbox/MvcSandbox.csproj | 2 -- ...Microsoft.AspNetCore.Mvc.TestCommon.csproj | 4 ++-- ...soft.AspNetCore.Mvc.FunctionalTests.csproj | 3 +++ ...ControllersFromServicesClassLibrary.csproj | 2 ++ .../ControllersFromServicesWebSite.csproj | 2 ++ .../RazorBuildWebSite.csproj | 7 ------- .../WebSites/RazorWebSite/RazorWebSite.csproj | 2 ++ 12 files changed, 18 insertions(+), 44 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 57db423e18..b5f3763217 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -87,14 +87,6 @@ 2.1.7 2.1.7 2.1.7 - - - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 2.1.1 diff --git a/eng/scripts/CodeCheck.ps1 b/eng/scripts/CodeCheck.ps1 index f801899563..9ad0c6d642 100644 --- a/eng/scripts/CodeCheck.ps1 +++ b/eng/scripts/CodeCheck.ps1 @@ -32,7 +32,7 @@ try { $slnDir = Split-Path -Parent $_ $sln = $_ & dotnet sln $_ list ` - | ? { $_ -ne 'Project(s)' -and $_ -ne '----------' } ` + | ? { $_ -like '*proj' } ` | % { $proj = Join-Path $slnDir $_ if (-not (Test-Path $proj)) { diff --git a/src/Mvc/Mvc.Razor/src/Microsoft.AspNetCore.Mvc.Razor.csproj b/src/Mvc/Mvc.Razor/src/Microsoft.AspNetCore.Mvc.Razor.csproj index 438e9ef5ef..fb70c4474c 100644 --- a/src/Mvc/Mvc.Razor/src/Microsoft.AspNetCore.Mvc.Razor.csproj +++ b/src/Mvc/Mvc.Razor/src/Microsoft.AspNetCore.Mvc.Razor.csproj @@ -18,10 +18,9 @@ - - - - + + + @@ -30,24 +29,11 @@ - - diff --git a/src/Mvc/Mvc.TagHelpers/src/Microsoft.AspNetCore.Mvc.TagHelpers.csproj b/src/Mvc/Mvc.TagHelpers/src/Microsoft.AspNetCore.Mvc.TagHelpers.csproj index 1cd35a40b1..2af2516ca1 100644 --- a/src/Mvc/Mvc.TagHelpers/src/Microsoft.AspNetCore.Mvc.TagHelpers.csproj +++ b/src/Mvc/Mvc.TagHelpers/src/Microsoft.AspNetCore.Mvc.TagHelpers.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/Mvc/Mvc/src/Microsoft.AspNetCore.Mvc.csproj b/src/Mvc/Mvc/src/Microsoft.AspNetCore.Mvc.csproj index 11964b7926..66495371e0 100644 --- a/src/Mvc/Mvc/src/Microsoft.AspNetCore.Mvc.csproj +++ b/src/Mvc/Mvc/src/Microsoft.AspNetCore.Mvc.csproj @@ -20,12 +20,8 @@ - - None - - - None - + + diff --git a/src/Mvc/samples/MvcSandbox/MvcSandbox.csproj b/src/Mvc/samples/MvcSandbox/MvcSandbox.csproj index 27a8ad2cff..ec148de762 100644 --- a/src/Mvc/samples/MvcSandbox/MvcSandbox.csproj +++ b/src/Mvc/samples/MvcSandbox/MvcSandbox.csproj @@ -12,8 +12,6 @@ - - diff --git a/src/Mvc/shared/Mvc.TestCommon/Microsoft.AspNetCore.Mvc.TestCommon.csproj b/src/Mvc/shared/Mvc.TestCommon/Microsoft.AspNetCore.Mvc.TestCommon.csproj index d1d33183f1..cd612b0c93 100644 --- a/src/Mvc/shared/Mvc.TestCommon/Microsoft.AspNetCore.Mvc.TestCommon.csproj +++ b/src/Mvc/shared/Mvc.TestCommon/Microsoft.AspNetCore.Mvc.TestCommon.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj b/src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj index 00e7e4be5a..eada79a64f 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj +++ b/src/Mvc/test/Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj @@ -31,6 +31,9 @@ + + + diff --git a/src/Mvc/test/WebSites/ControllersFromServicesClassLibrary/ControllersFromServicesClassLibrary.csproj b/src/Mvc/test/WebSites/ControllersFromServicesClassLibrary/ControllersFromServicesClassLibrary.csproj index 7b342c5188..a5f7b2c254 100644 --- a/src/Mvc/test/WebSites/ControllersFromServicesClassLibrary/ControllersFromServicesClassLibrary.csproj +++ b/src/Mvc/test/WebSites/ControllersFromServicesClassLibrary/ControllersFromServicesClassLibrary.csproj @@ -8,5 +8,7 @@ + + diff --git a/src/Mvc/test/WebSites/ControllersFromServicesWebSite/ControllersFromServicesWebSite.csproj b/src/Mvc/test/WebSites/ControllersFromServicesWebSite/ControllersFromServicesWebSite.csproj index 97813ee279..76bd2977ca 100644 --- a/src/Mvc/test/WebSites/ControllersFromServicesWebSite/ControllersFromServicesWebSite.csproj +++ b/src/Mvc/test/WebSites/ControllersFromServicesWebSite/ControllersFromServicesWebSite.csproj @@ -9,6 +9,8 @@ + + diff --git a/src/Mvc/test/WebSites/RazorBuildWebSite/RazorBuildWebSite.csproj b/src/Mvc/test/WebSites/RazorBuildWebSite/RazorBuildWebSite.csproj index 2cea31cc81..eb459ef73c 100644 --- a/src/Mvc/test/WebSites/RazorBuildWebSite/RazorBuildWebSite.csproj +++ b/src/Mvc/test/WebSites/RazorBuildWebSite/RazorBuildWebSite.csproj @@ -19,13 +19,6 @@ - - - - diff --git a/src/Mvc/test/WebSites/RazorWebSite/RazorWebSite.csproj b/src/Mvc/test/WebSites/RazorWebSite/RazorWebSite.csproj index be6ee3b5fe..9b08bd081b 100644 --- a/src/Mvc/test/WebSites/RazorWebSite/RazorWebSite.csproj +++ b/src/Mvc/test/WebSites/RazorWebSite/RazorWebSite.csproj @@ -13,6 +13,8 @@ + + From e0a4673e0b7c318bc2a1f8c5dc2a8bef31620d8b Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 15 Apr 2019 10:49:43 -0700 Subject: [PATCH 2/5] Add missing package archives (#9351) - not mandatory (it seems) for 2.1 but useful pseudo-documentation --- .../Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.10.txt | 0 .../Archive.CiServer.Patch/ArchiveBaseline.2.1.10.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.10.txt create mode 100644 src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.10.txt diff --git a/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.10.txt b/src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.10.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.10.txt b/src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.10.txt new file mode 100644 index 0000000000..e69de29bb2 From 836964a653e355fe4e28241e0ff485dfb5d3ccdf Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 15 Apr 2019 13:29:07 -0700 Subject: [PATCH 3/5] Don't log action and page handler arguments above Trace level (#9227) --- eng/PatchConfig.props | 2 + .../src/Internal/MvcCoreLoggerExtensions.cs | 45 +++++++++++++------ .../src/Internal/PageLoggerExtensions.cs | 30 +++++++------ 3 files changed, 49 insertions(+), 28 deletions(-) diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props index 29e74d4f85..9afa0e2572 100644 --- a/eng/PatchConfig.props +++ b/eng/PatchConfig.props @@ -28,6 +28,8 @@ Later on, this will be checked using this condition: + Microsoft.AspNetCore.Mvc.Core; + Microsoft.AspNetCore.Mvc.RazorPages; diff --git a/src/Mvc/Mvc.Core/src/Internal/MvcCoreLoggerExtensions.cs b/src/Mvc/Mvc.Core/src/Internal/MvcCoreLoggerExtensions.cs index c840f785b1..7ce747f03f 100644 --- a/src/Mvc/Mvc.Core/src/Internal/MvcCoreLoggerExtensions.cs +++ b/src/Mvc/Mvc.Core/src/Internal/MvcCoreLoggerExtensions.cs @@ -32,6 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal private static readonly double TimestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency; private static readonly Action _actionExecuting; + private static readonly Action _controllerActionExecuting; private static readonly Action _actionExecuted; private static readonly Action _challengeResultExecuting; @@ -39,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal private static readonly Action _contentResultExecuting; private static readonly Action _actionMethodExecuting; - private static readonly Action _actionMethodExecutingWithArguments; + private static readonly Action _actionMethodExecutingWithArguments; private static readonly Action _actionMethodExecuted; private static readonly Action _logFilterExecutionPlan; @@ -153,6 +154,11 @@ namespace Microsoft.AspNetCore.Mvc.Internal 1, "Route matched with {RouteData}. Executing action {ActionName}"); + _controllerActionExecuting = LoggerMessage.Define( + LogLevel.Information, + 3, + "Route matched with {RouteData}. Executing controller action with signature {MethodInfo} on controller {Controller} ({AssemblyName})."); + _actionExecuted = LoggerMessage.Define( LogLevel.Information, 2, @@ -173,10 +179,10 @@ namespace Microsoft.AspNetCore.Mvc.Internal 1, "Executing action method {ActionName} - Validation state: {ValidationState}"); - _actionMethodExecutingWithArguments = LoggerMessage.Define( - LogLevel.Information, - 1, - "Executing action method {ActionName} with arguments ({Arguments}) - Validation state: {ValidationState}"); + _actionMethodExecutingWithArguments = LoggerMessage.Define( + LogLevel.Trace, + 3, + "Executing action method {ActionName} with arguments ({Arguments})"); _actionMethodExecuted = LoggerMessage.Define( LogLevel.Information, @@ -683,7 +689,22 @@ namespace Microsoft.AspNetCore.Mvc.Internal } } - _actionExecuting(logger, stringBuilder.ToString(), action.DisplayName, null); + if (action is ControllerActionDescriptor controllerActionDescriptor) + { + var controllerType = controllerActionDescriptor.ControllerTypeInfo.AsType(); + var controllerName = TypeNameHelper.GetTypeDisplayName(controllerType); + _controllerActionExecuting( + logger, + stringBuilder.ToString(), + controllerActionDescriptor.MethodInfo, + controllerName, + controllerType.Assembly.GetName().Name, + null); + } + else + { + _actionExecuting(logger, stringBuilder.ToString(), action.DisplayName, null); + } } } @@ -814,21 +835,17 @@ namespace Microsoft.AspNetCore.Mvc.Internal var actionName = context.ActionDescriptor.DisplayName; var validationState = context.ModelState.ValidationState; + _actionMethodExecuting(logger, actionName, validationState, null); - string[] convertedArguments; - if (arguments == null) + if (arguments != null && logger.IsEnabled(LogLevel.Trace)) { - _actionMethodExecuting(logger, actionName, validationState, null); - } - else - { - convertedArguments = new string[arguments.Length]; + var convertedArguments = new string[arguments.Length]; for (var i = 0; i < arguments.Length; i++) { convertedArguments[i] = Convert.ToString(arguments[i]); } - _actionMethodExecutingWithArguments(logger, actionName, convertedArguments, validationState, null); + _actionMethodExecutingWithArguments(logger, actionName, convertedArguments, null); } } } diff --git a/src/Mvc/Mvc.RazorPages/src/Internal/PageLoggerExtensions.cs b/src/Mvc/Mvc.RazorPages/src/Internal/PageLoggerExtensions.cs index a5d7c960d4..fcca656b9d 100644 --- a/src/Mvc/Mvc.RazorPages/src/Internal/PageLoggerExtensions.cs +++ b/src/Mvc/Mvc.RazorPages/src/Internal/PageLoggerExtensions.cs @@ -15,7 +15,8 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal { public const string PageFilter = "Page Filter"; - private static readonly Action _handlerMethodExecuting; + private static readonly Action _handlerMethodExecuting; + private static readonly Action _handlerMethodExecutingWithArguments; private static readonly Action _handlerMethodExecuted; private static readonly Action _pageFilterShortCircuit; private static readonly Action _malformedPageDirective; @@ -28,10 +29,15 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal { // These numbers start at 101 intentionally to avoid conflict with the IDs used by ResourceInvoker. - _handlerMethodExecuting = LoggerMessage.Define( + _handlerMethodExecuting = LoggerMessage.Define( LogLevel.Information, 101, - "Executing handler method {HandlerName} with arguments ({Arguments}) - ModelState is {ValidationState}"); + "Executing handler method {HandlerName} - ModelState is {ValidationState}"); + + _handlerMethodExecutingWithArguments = LoggerMessage.Define( + LogLevel.Trace, + 103, + "Executing handler method {HandlerName} with arguments ({Arguments})"); _handlerMethodExecuted = LoggerMessage.Define( LogLevel.Debug, @@ -75,23 +81,19 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal { var handlerName = handler.MethodInfo.Name; - string[] convertedArguments; - if (arguments == null) + var validationState = context.ModelState.ValidationState; + _handlerMethodExecuting(logger, handlerName, validationState, null); + + if (arguments != null && logger.IsEnabled(LogLevel.Trace)) { - convertedArguments = null; - } - else - { - convertedArguments = new string[arguments.Length]; + var convertedArguments = new string[arguments.Length]; for (var i = 0; i < arguments.Length; i++) { convertedArguments[i] = Convert.ToString(arguments[i]); } + + _handlerMethodExecutingWithArguments(logger, handlerName, convertedArguments, null); } - - var validationState = context.ModelState.ValidationState; - - _handlerMethodExecuting(logger, handlerName, convertedArguments, validationState, null); } } From 79e98dd169d8bf544546149ec3d78b715ba7ca3a Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 15 Apr 2019 15:19:40 -0700 Subject: [PATCH 4/5] Update dependency version of Extensions.Binder to avoid downgrading sharedfx versions from 2.1.10 (#9393) --- build/dependencies.props | 4 +--- test/SharedFx.UnitTests/SharedFxTests.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index b5f3763217..2708f9c713 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,10 +4,7 @@ 2.1.10 2.1.10 - 4.5.2 - - 2.1.1 @@ -35,6 +32,7 @@ 2.1.1 2.1.1 2.1.1 + 2.1.10 2.1.1 2.1.1 2.1.1 diff --git a/test/SharedFx.UnitTests/SharedFxTests.cs b/test/SharedFx.UnitTests/SharedFxTests.cs index 7d0c222298..de57b07f70 100644 --- a/test/SharedFx.UnitTests/SharedFxTests.cs +++ b/test/SharedFx.UnitTests/SharedFxTests.cs @@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore var localAssemblyVersion = AssemblyName.GetAssemblyName(file).Version; var dllName = Path.GetFileName(file); Assert.Contains(dllName, nugetAssemblyVersions.Keys); - Assert.InRange(localAssemblyVersion.CompareTo(nugetAssemblyVersions[dllName]), 0, int.MaxValue); + Assert.True(localAssemblyVersion >= nugetAssemblyVersions[dllName], $"Expected {dllName} ({localAssemblyVersion}) to have assembly version >= {nugetAssemblyVersions[dllName]}"); } catch (BadImageFormatException) { } From dad3703d1beaed8bb4aba469daf6b3fc97de0b50 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Mon, 15 Apr 2019 16:08:43 -0700 Subject: [PATCH 5/5] [2.1] Include EntityFrameworkCore in the 2.1.11 patch (#9397) --- build/dependencies.props | 6 +++--- build/submodules.props | 2 +- modules/EntityFrameworkCore | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 2708f9c713..f79db993c1 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -131,9 +131,9 @@ 3.14.2 5.2.0 5.2.0 - 1.0.11 - 1.1.8 - 2.0.7 + 1.0.15 + 1.1.12 + 2.0.9 1.0.1 15.9.0 3.0.1 diff --git a/build/submodules.props b/build/submodules.props index 4370c412c7..a088430493 100644 --- a/build/submodules.props +++ b/build/submodules.props @@ -37,6 +37,6 @@ - + diff --git a/modules/EntityFrameworkCore b/modules/EntityFrameworkCore index 80a5f92597..e8f2f1ef03 160000 --- a/modules/EntityFrameworkCore +++ b/modules/EntityFrameworkCore @@ -1 +1 @@ -Subproject commit 80a5f9259776c41f30e5a63e3c9fdd240ce3be2d +Subproject commit e8f2f1ef030701048cd47898a7d7d70a58342ba4