There was an old thread over a year ago about this which explains how changing the settings on the built in firewall will affect file sharing and vice versa:
Turning Windows Firewall off changes Network discovery File sharing on - Windows 10 Forums

Does anyone know why this happens?