Merge changes from 'release/2.1'

This commit is contained in:
Nate McMaster 2019-04-15 17:01:59 -07:00
commit fafae36461
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
7 changed files with 56 additions and 37 deletions

View File

@ -4,10 +4,7 @@
<!-- MicrosoftNETCoreApp21PackageVersion is assigned at the bottom so it can automatically pick up MicrosoftNETCoreAppPackageVersion in an orchestrated build. -->
<MicrosoftNETCoreAppPackageVersion>2.1.10</MicrosoftNETCoreAppPackageVersion>
<MicrosoftNETCoreDotNetAppHostPackageVersion>2.1.10</MicrosoftNETCoreDotNetAppHostPackageVersion>
<SystemNetHttpWinHttpHandlerPackageVersion>4.5.2</SystemNetHttpWinHttpHandlerPackageVersion>
<MicrosoftExtensionsConfigurationBinderPackageVersion>2.1.1</MicrosoftExtensionsConfigurationBinderPackageVersion>
</PropertyGroup>
<Import Project="$(DotNetPackageVersionPropsPath)" Condition="'$(DotNetPackageVersionPropsPath)' != ''" />
@ -35,6 +32,7 @@
<MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>2.1.1</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
<MicrosoftExtensionsConfigurationAbstractionsPackageVersion>2.1.1</MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
<MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>2.1.1</MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>
<MicrosoftExtensionsConfigurationBinderPackageVersion>2.1.10</MicrosoftExtensionsConfigurationBinderPackageVersion>
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.1</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>2.1.1</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
<MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>2.1.1</MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>
@ -133,9 +131,9 @@
<MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>3.14.2</MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>
<MicrosoftIdentityModelProtocolsOpenIdConnectPackageVersion>5.2.0</MicrosoftIdentityModelProtocolsOpenIdConnectPackageVersion>
<MicrosoftIdentityModelProtocolsWsFederationPackageVersion>5.2.0</MicrosoftIdentityModelProtocolsWsFederationPackageVersion>
<MicrosoftNETCoreApp10PackageVersion>1.0.11</MicrosoftNETCoreApp10PackageVersion>
<MicrosoftNETCoreApp11PackageVersion>1.1.8</MicrosoftNETCoreApp11PackageVersion>
<MicrosoftNETCoreApp20PackageVersion>2.0.7</MicrosoftNETCoreApp20PackageVersion>
<MicrosoftNETCoreApp10PackageVersion>1.0.15</MicrosoftNETCoreApp10PackageVersion>
<MicrosoftNETCoreApp11PackageVersion>1.1.12</MicrosoftNETCoreApp11PackageVersion>
<MicrosoftNETCoreApp20PackageVersion>2.0.9</MicrosoftNETCoreApp20PackageVersion>
<MicrosoftNETCoreWindowsApiSetsPackageVersion>1.0.1</MicrosoftNETCoreWindowsApiSetsPackageVersion>
<MicrosoftNETTestSdkPackageVersion>15.9.0</MicrosoftNETTestSdkPackageVersion>
<MicrosoftOwinSecurityCookiesPackageVersion>3.0.1</MicrosoftOwinSecurityCookiesPackageVersion>

View File

@ -37,6 +37,6 @@
<ItemGroup>
<Repository Include="Templating" PatchPolicy="AlwaysUpdateAndCascadeVersions" RootPath="$(RepositoryRoot)src\Templating\" />
<ShippedRepository Include="EntityFrameworkCore" />
<Repository Include="EntityFrameworkCore" />
</ItemGroup>
</Project>

View File

@ -28,6 +28,8 @@ Later on, this will be checked using this condition:
</PropertyGroup>
<PropertyGroup Condition=" '$(VersionPrefix)' == '2.1.11' ">
<PackagesInPatch>
Microsoft.AspNetCore.Mvc.Core;
Microsoft.AspNetCore.Mvc.RazorPages;
Microsoft.AspNetCore.SignalR.Protocols.MessagePack;
Microsoft.AspNetCore.SignalR.Redis;
</PackagesInPatch>

@ -1 +1 @@
Subproject commit 80a5f9259776c41f30e5a63e3c9fdd240ce3be2d
Subproject commit e8f2f1ef030701048cd47898a7d7d70a58342ba4

View File

@ -32,6 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
private static readonly double TimestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency;
private static readonly Action<ILogger, string, string, Exception> _actionExecuting;
private static readonly Action<ILogger, string, MethodInfo, string, string, Exception> _controllerActionExecuting;
private static readonly Action<ILogger, string, double, Exception> _actionExecuted;
private static readonly Action<ILogger, string[], Exception> _challengeResultExecuting;
@ -39,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
private static readonly Action<ILogger, string, Exception> _contentResultExecuting;
private static readonly Action<ILogger, string, ModelValidationState, Exception> _actionMethodExecuting;
private static readonly Action<ILogger, string, string[], ModelValidationState, Exception> _actionMethodExecutingWithArguments;
private static readonly Action<ILogger, string, string[], Exception> _actionMethodExecutingWithArguments;
private static readonly Action<ILogger, string, string, double, Exception> _actionMethodExecuted;
private static readonly Action<ILogger, string, string[], Exception> _logFilterExecutionPlan;
@ -153,6 +154,11 @@ namespace Microsoft.AspNetCore.Mvc.Internal
1,
"Route matched with {RouteData}. Executing action {ActionName}");
_controllerActionExecuting = LoggerMessage.Define<string, MethodInfo, string, string>(
LogLevel.Information,
3,
"Route matched with {RouteData}. Executing controller action with signature {MethodInfo} on controller {Controller} ({AssemblyName}).");
_actionExecuted = LoggerMessage.Define<string, double>(
LogLevel.Information,
2,
@ -173,10 +179,10 @@ namespace Microsoft.AspNetCore.Mvc.Internal
1,
"Executing action method {ActionName} - Validation state: {ValidationState}");
_actionMethodExecutingWithArguments = LoggerMessage.Define<string, string[], ModelValidationState>(
LogLevel.Information,
1,
"Executing action method {ActionName} with arguments ({Arguments}) - Validation state: {ValidationState}");
_actionMethodExecutingWithArguments = LoggerMessage.Define<string, string[]>(
LogLevel.Trace,
3,
"Executing action method {ActionName} with arguments ({Arguments})");
_actionMethodExecuted = LoggerMessage.Define<string, string, double>(
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);
}
}
}

View File

@ -15,7 +15,8 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
{
public const string PageFilter = "Page Filter";
private static readonly Action<ILogger, string, string[], ModelValidationState, Exception> _handlerMethodExecuting;
private static readonly Action<ILogger, string, ModelValidationState, Exception> _handlerMethodExecuting;
private static readonly Action<ILogger, string, string[], Exception> _handlerMethodExecutingWithArguments;
private static readonly Action<ILogger, string, string, Exception> _handlerMethodExecuted;
private static readonly Action<ILogger, object, Exception> _pageFilterShortCircuit;
private static readonly Action<ILogger, string, string[], Exception> _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<string, string[], ModelValidationState>(
_handlerMethodExecuting = LoggerMessage.Define<string, ModelValidationState>(
LogLevel.Information,
101,
"Executing handler method {HandlerName} with arguments ({Arguments}) - ModelState is {ValidationState}");
"Executing handler method {HandlerName} - ModelState is {ValidationState}");
_handlerMethodExecutingWithArguments = LoggerMessage.Define<string, string[]>(
LogLevel.Trace,
103,
"Executing handler method {HandlerName} with arguments ({Arguments})");
_handlerMethodExecuted = LoggerMessage.Define<string, string>(
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);
}
}

View File

@ -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) { }