This network port is a most frustrating issue ... my experience is a little different to most here but maybe of interest or add another piece to the puzzle.
My configuration is Win10, Arduino IDE 1.8.10, ESP8266 core 2.6.3, ESP-01 module.
OTA works fine with the BasicOTA example ... flash via serial and the network port pops right up.
I disconnect the serial connection and I can do OTA multiple updates just fine. Rock solid and repeatable. This makes me think that all the necessary bits are working: router, IDE, MDNS, etc.
So what's the problem?
I copy the OTA code to a more complex sketch (~750 lines of code) and the network port no longer appears. Restarting IDE / Win10 / ESP-01, regedit hack, do not help. Also plenty of space for OTA.
Now if I open both sketches and load BasicOTA via serial (network port pops up straight away), then switch to my sketch, I can see the network port and I can upload multiple times to the same module. (also repeatable)
If I shut down both sketches and open just my sketch, the network port is no longer there. (repeatable)
Digging into the OTA / MDNS libraries is of little help. ArduinoOTA.begin() calls MDNS.begin() as it should. ArduinoOTA.handle() calls MDNS.update() as it should. Note: if your "security" for OTA involves not running the OTA handler unless some flag/switch is turned on, you will need to insert your own MDNS.update() in the loop.
Frustrating!
Update: 22/1/2020 - understand behavior now
My code runs WiFi mode WIFI_AP_STA at startup.
After more digging in the MDNS library, looks like if both AP and STA are connected and no IP address is passed in the call to MDNS.begin(), the library will preference AP's address (and subnet). This is verified by logging on to the local AP from my iPad and typing "hostname".local. The name is resolved OK. My Arduino IDE is on the sta subnet!
Modified my code to be WIFI_STA only and network port pops up (note: the registry hack to stop LLMNR multicast makes no difference for me).
I need WIFI_AP_STA for my app. Workaround is to handle the MDNS outside of the OTA library.
In setup() I've added the following between starting WiFi and starting OTA:
extern MDNSResponder MDNS;
MDNS.begin("TestHost", WiFi.localIP(), 0);
And in the loop() I've added:
MDNS.update();
You still need to let ArduinoOTA.begin(true) start so it can advertise to the IDE on port 8266.
NOTE: People who were looking for a way to "force" and IP address for the network port ... this is an possible way to do it.