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

ArgumentNullException with ActivatorUtilities.CreateInstance() with upcoming dotnet 8 #677

Closed
trapwired opened this issue Aug 16, 2023 · 2 comments
Assignees
Labels
2.0 SuperSocket 2.0 bug

Comments

@trapwired
Copy link

return ActivatorUtilities.CreateInstance(null, this.CommandSetFactoryType, commandTyeInfo) as ICommandSetFactory;

In the upcoming dotnet 8 upgrade, Microsoft makes a breaking change at
Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters) See here on microsoft.learn: The two ActivatorUtilities.CreateInstance methods now throw an ArgumentNullException exception if the provider parameter is null.

Using the preview Version of Microsoft.Extensions.DependencyInjection, the following exception is thrown at CommandMiddleware.cs#L259, because null is passed explicitly. Complete exception: System.ArgumentNullException : Value cannot be null. (Parameter 'provider')

@kerryjiang kerryjiang self-assigned this Aug 26, 2023
@kerryjiang kerryjiang added bug 2.0 SuperSocket 2.0 labels Aug 26, 2023
@kerryjiang
Copy link
Owner

kerryjiang commented Aug 26, 2023

Thanks for this information. I will fix it pretty soon.

@kerryjiang
Copy link
Owner

It has been fixed by this commit:
07d5a6f

And the beta 18 has this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 SuperSocket 2.0 bug
Projects
None yet
Development

No branches or pull requests

2 participants