datetimepicker icon indicating copy to clipboard operation
datetimepicker copied to clipboard

[react-native-windows] REGDB_E_CLASSNOTREG error in RoGetActivationFactory

Open taenri opened this issue 3 years ago • 0 comments

On Windows 11, react-native-windows version 0.68.2 we get a runtime error when trying to use the DateTimePicker after following the manual setup instructions outlined in the repo.

The error occurs when we try to create a new instance of winrt::DateTimePicker::ReactPackageProvider in our App class. The error code is REGDB_E_CLASSNOTREG error, which happens after calling RoGetActivationFactory for the winrt class name DateTimePicker.ReactPackageProvider.

This happens because the winrt class namespace does not match the DLL name. Either the winrt namespace needs to be renamed to DateTimePickerWindows, or the DateTimePickerWindows project/dll needs to be renamed to just DateTimePicker. I have tested this with local modifications to the vcxproj, and after these changes the date time picker works as expected.

taenri avatar Jul 25 '22 18:07 taenri