Merge branch 'master' into merge/release/3.0-preview4-to-master\n\nCommit migrated from 4e6fd53c68

This commit is contained in:
Doug Bunting 2019-04-16 09:09:15 -07:00 committed by GitHub
commit bb278bf19d
2 changed files with 6 additions and 2 deletions

View File

@ -403,16 +403,20 @@ namespace Microsoft.Extensions.Internal
}
}
#if NETCOREAPP3_0
return _constructor.Invoke(BindingFlags.DoNotWrapExceptions, binder: null, parameters: _parameterValues, culture: null);
#else
try
{
return _constructor.Invoke(_parameterValues);
}
catch (TargetInvocationException ex)
catch (TargetInvocationException ex) when (ex.InnerException != null)
{
ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
// The above line will always throw, but the compiler requires we throw explicitly.
throw;
}
#endif
}
}

View File

@ -12,4 +12,4 @@ namespace Microsoft.AspNetCore.Testing.xunit
public class ConditionalFactAttribute : FactAttribute
{
}
}
}