Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDNS does not start in UWP app #21

Closed
queequac opened this issue Aug 11, 2018 · 5 comments
Closed

MDNS does not start in UWP app #21

queequac opened this issue Aug 11, 2018 · 5 comments

Comments

@queequac
Copy link

I was always looking for a MDNS library that can query and announce services at the same time. Seems your library could be the perfect match. :)

While I got it running within .NET 4.6.1, it seems no to work for a Windows 10 UWP app.
I took your browser sample from here: https://github.com/richardschneider/net-mdns/blob/master/Browser/Program.cs

I have set all neccessary capabilities for private network and so on, and I split the code into one half setting up handlers and starting the service and another half that stops and disposes.

But unfortunately it seems the multicast service does not even start.
First I realized I never get the NetworkInterfaceDiscovered event... so I added another button for testing purposes which shall do the query anyway - but this one always throws an exception that mdns got not started. So I am wondering what could block mdns.start(); internally from starting?

Can anyone confirm this for UWP?

@richardschneider
Copy link
Owner

Did you make any changes to support .NET 4.6.1? If so can you make a PR.

I have no experience with Windows 10 UWP. Please point me to the repo that has the App for UWP. I'll be happy to debug it.

@richardschneider
Copy link
Owner

After some investigation, it appears that System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces is throwing a NotImplementedException; see this issue.

@richardschneider
Copy link
Owner

You need to set the UWP min version target to Build 16299; this uses .Net Standard 2 and implements GetAllNetworkInterfaces.

target

@queequac
Copy link
Author

Ah, thanks for investigating!
Unfortunately my app is out in the wild and last version of Windows 10 Mobile does not support the FCU update (it does, but not on API level). That was yet another reason why I wanted to switch from Zeroconf, which also supports only .NET Standard 2 starting with their v3 release.

Do you consider supporting 1.4? Your current readme.md and the library's dependency graph do otherwise just "trick" people like me. :)

@richardschneider
Copy link
Owner

.Net Standard 1.4 is supported and is tested against CoreApp 1.1 See the Appveyor logs or try it on your machine with dotnet test -c Release test.

For 1.4 the package "System.Net.NetworkInformation" Version="4.3.0" is included. It appears that UWP does not include this package.

I'm sorry, bit I'm not interested in supporting old versions of UWP. However, if you can figure out how to get old UWP to use new NetworkInformation then I am glad to accept a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants