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

Invocation of static command on ViewModel does not resolve dependecies from IoC #1738

Closed
Ropack opened this issue Nov 18, 2023 · 1 comment
Closed

Comments

@Ropack
Copy link
Contributor

Ropack commented Nov 18, 2023

When I create a method in my ViewModel class - class that inherits from DotvvmViewModelBase, I give it an AllowStaticCommand attribute and call it from View with staticCommand binding, then the dependecies in a constructor are not resolved, they are null instead. When the same method and dependencies are moved to separate class and I register it to the serviceCollection, the dependencies are resolved as expected.

DotVVM version 4.1.0
net7.0

@exyi
Copy link
Member

exyi commented Nov 19, 2023

This is a known problem (#809), we finally have an option to disable the bug: DotvvmConfiguration.ExperimentalFeatures.UseDotvvmSerializationForStaticCommandArguments.Enable()

@exyi exyi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants