I am trying this but it does not always work:
using Rssdp;
using System;
namespace Discovery {
class Program {
static void Main(string[] args) {
SearchForDevices();
Console.ReadKey();
}
public static async void SearchForDevices() {
using (var deviceLocator = new SsdpDeviceLocator()) {
var foundDevices = await deviceLocator.SearchAsync();
foreach (var foundDevice in foundDevices) {
Console.WriteLine("Found " + foundDevice.Usn + " at " + foundDevice.DescriptionLocation.ToString());
}
}
}
}
}
It only shows output for the first 3 runs or so. Then for the rest of the day I get nothing. I have checked the firewall settings in windows and allowed UDP in and out on all ports. Still the same. Not even sure how to debug.
I am running this from .NET Core Console App, in Windows 10.
I am trying this but it does not always work:
It only shows output for the first 3 runs or so. Then for the rest of the day I get nothing. I have checked the firewall settings in windows and allowed UDP in and out on all ports. Still the same. Not even sure how to debug.
I am running this from .NET Core Console App, in Windows 10.