If you are able to set the Network Discovery, however it turns itself off automatically, you may have to enable and start a few services.
In the Windows Control Panel, navigate to: Administrative Tools > Services
Set the following services to automatic (right-click, properties), and start them:
DNS Client
Function Discovery Resource Publication
SSDP Discovery
UPnP Device Host
After enabling those four service, navigate back to your network sharing settings, under "Network and Internet > Network and Sharing Center > Advanced Sharing Settings > Turn on network discovery". The setting should now remain enabled.
See also:
Cannot enable Network Discovery?