Thank you for pointing this out to us. I was able to reproduce what you described using your repro steps (very clear, thank you!), and have submitted a report of my observations to have this investigated further (UE-21466).
Not a bug, the WidgetBlueprint is an editor only class. You can tell because it’s in a module in the Editor directory. UBlueprints should’ve been and hopefully will in the future. You need to reference the generated UClass instead, the “_C” object that’s generated when you compile a blueprint, instead of the WidgetBlueprint. e.g.
thanks for Your answers. Hmm… I think I have found similiar problem, this time with regular blueprint (not UserWidget). Repro steps are almost identical:
Create new project based on “first person” c++ example.
In content folder create blueprintt (AddNew->BlueprintClass), inherit it from Actor and name it BP_MyBP.
Open VS, and go to [ProjectName]Character.cpp file.
After packageing is done go to packaged project and run game
Game will prompt that BP_MyBp was not found
conslusion is that this issue is not limited to Widgets but to all blueprint classes. Most likely the problem here is that code posted here is executed very early and engine maybe not initialized at this point. If I move this code to other consttructor that runs AFTER begin play event it works as expected.