I have had this problem for about two weeks. My windows 10 Pro I use for a home server stopped sharing files.
Network Discovery keeps turning itself off
When I checked Turn On Network Discovery setting in Change Advanced Sharing Settings it was off. I set it back to on rebooted and checked again and it was off again.
I spent hours looking for a solution which seemed to be to ensure the following services were started.
DNS Client
Function Discovery Resource Publication
SSDP Discovery
UPnP Device Host
All were running but DNS Client settings were greyed out in properties.
I could get the sharing to work for a while by restarting the other 3 services but a server reboot and the shares were gone again.
In the end I tried this and it has so far fixed the issue.
Use regedit to find
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache
Double click the Start value in the right hand window and change the value to 1.
This will change the startup type to System which seems to have fixed my issue.
Make sure you turn on Network Discovery in Change Advanced Sharing Settings.
Saw that a few people have had this issue so thought I'd post this.