Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove workarounds from ParameterDefaultValue class #42491

Closed
wants to merge 1 commit into from
Closed

Remove workarounds from ParameterDefaultValue class #42491

wants to merge 1 commit into from

Conversation

am11
Copy link
Member

@am11 am11 commented Sep 19, 2020

No description provided.

@am11
Copy link
Member Author

am11 commented Sep 19, 2020

Closing this because .NET Framework 4.8 still requires a workaround for #18844. net48 leg failed with:

Microsoft.Extensions.DependencyInjection.Specification.UnityDependencyInjectionSpecificationTests.TypeActivatorWorksWithCtorWithOptionalArgs_WithStructDefaults(createFunc: CreateInstanceFunc { Method = System.Object CreateInstanceDirectly(System.IServiceProvider, System.Type, System.Object[]), Target = null }) [FAIL]
      System.FormatException : Encountered an invalid type for a default value.
      Stack Trace:
           at System.Reflection.MdConstant.GetValue(MetadataImport scope, Int32 token, RuntimeTypeHandle fieldTypeHandle, Boolean raw)
           at System.Reflection.RuntimeParameterInfo.GetDefaultValueInternal(Boolean raw)
           at System.Reflection.RuntimeParameterInfo.get_HasDefaultValue()
        /_/src/libraries/Common/src/Extensions/ParameterDefaultValue/ParameterDefaultValue.cs(17,0): at Microsoft.Extensions.Internal.ParameterDefaultValue.TryGetDefaultValue(ParameterInfo parameter, Object& defaultValue)
        /_/src/libraries/Common/src/Extensions/ActivatorUtilities/ActivatorUtilities.cs(410,0): at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
        /_/src/libraries/Common/src/Extensions/ActivatorUtilities/ActivatorUtilities.cs(93,0): at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
        /_/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Specification.Tests/ActivatorUtilitiesTests.cs(30,0): at Microsoft.Extensions.DependencyInjection.Specification.DependencyInjectionSpecificationTests.CreateInstance[T](CreateInstanceFunc func, IServiceProvider provider, Object[] args)
        /_/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Specification.Tests/ActivatorUtilitiesTests.cs(109,0): at Microsoft.Extensions.DependencyInjection.Specification.DependencyInjectionSpecificationTests.TypeActivatorWorksWithCtorWithOptionalArgs_WithStructDefaults(CreateInstanceFunc createFunc)

@am11 am11 closed this Sep 19, 2020
@am11 am11 deleted the feature/obsolete-workarounds branch November 29, 2020 12:07
@ghost ghost locked as resolved and limited conversation to collaborators Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants