Solution:
in unity2018 or newer, it’s not automatically import classes when importing projects with an older version. So you need to go to Player settings uncheck than check the “Visual Reality Supported”, then Unity will reload missing classes.
https://stackoverflow.com/questions/55237548/hololens-spatialmapping-not-available/56075067#56075067.