Here's what worked for me just now.
I've got a Surface Pro 4 i7/16GB with the Microsoft Dock, and it stubbornly refused to charge.
I went into Device Manager, ![](https://learn-attachment.microsoft.com/api/attachments/1f924923-6af6-422b-8472-31c1b800abbc?platform=QnA and for each of the "Microsoft AC Adapter" and "Microsoft Surface ACPI-Compliant Control Method Battery" devices, I selected them, right-clicked, "Uninstall Device", then went to Action, Scan for Hardware Changes, and it re-appeared. After doing that to each of them, my SP4 started charging again. No reboot necessary.
More info can be found in the Surface battery won’t charge troubleshooting article.
Hope that helps someone out there.
Your mileage may vary.
-KwM-