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

This commit is contained in:
Doug Bunting 2019-04-13 14:55:11 -07:00 committed by GitHub
commit 40fecb2de7
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 try
{ {
return _constructor.Invoke(_parameterValues); return _constructor.Invoke(_parameterValues);
} }
catch (TargetInvocationException ex) catch (TargetInvocationException ex) when (ex.InnerException != null)
{ {
ExceptionDispatchInfo.Capture(ex.InnerException).Throw(); ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
// The above line will always throw, but the compiler requires we throw explicitly. // The above line will always throw, but the compiler requires we throw explicitly.
throw; throw;
} }
#endif
} }
} }

View File

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