Throw exception when a class is not set to a definition before resolution
Better metrics when publishing