When I updated MikTeX through the automatic update program, I could not compile afterwards. It could not find pdftex-def. I then uninstalled MiKTeX and reinstalled it again. Now it is working again. If I run the update program again, I can see that pdftex-def is obsolete and will be removed. Is that was caused the problem in the first place? Is this a bug?
A clean install of MiKTeX solved the problem. Now I can run the automatic update via MiKTeX which automatic remove
pdftex-deffrom MikTeX, without any problems.
Edit: as pointed out by Ulrike Fischer, I did not need to make a clean install of MikTeX, just find the missing package and install that in the package manager.