richardschneider / net-mdns

Simple multicast DNS
MIT License
232 stars 81 forks source link

Tmds.Libc does dependency does not work with Xamarin.iOS #54

Closed clSharp closed 5 years ago

clSharp commented 5 years ago

The dependency on Tmds.Libc introduced to solve #22 breaks building for Xamarin.iOS. This is because when compiling for Xamarin.iOS all referenced assemblies are needed for the linker even if those assemblies will not be used at runtime. However, Tmds.Libc does not deliver any assemblies for Xamarin.iOS.

Perhaps it's possible to use the needed DllImports directly in net-mdns instead of depending on Tmds.Libc.

richardschneider commented 5 years ago

Thanks for taking the time to report an issue; I really appreciate the feedback!

Sadly I'm not supporting Xamarin.iOS. I've only read about Xamarian and have never played with it. If you want support for X-iOS then I need

I'm happy to try to find a work-around if you can provide the CI information.

clSharp commented 5 years ago

Thank you for putting all the work into this project!

Unfortunately getting CI running for Xamarin.iOS seems to be quite complicated. If I understand correctly this can only work if you have a MacOS build server.

However making net-mdns work with Xamarin.iOS should not be too complicated. I guess it was working before #22 was fixed. The only problem is that Tmds.Libc does not deliver an assembly for Xamarin.iOS. Although this assembly is not needed at runtime and will never be called the special nature of Xamarin.iOS build process makes it necessary that there is at least an assembly with dummy implementations.

The easiest solution would be to deliver a dummy assembly with Tmds.Libc, but I guess the maintainers of Tmds.Libc won't do that.

For now I will try the version before #22 was fixed or switch to Zeroconf Nuget package.

queequac commented 5 years ago

I am not an expert for nuget, but it might be sufficent to set the targetFramework for Tmds.Libc in the .nuspec file to "netcoreapp" (since there is no blacklisting capability for "xamarinios")?

richardschneider commented 5 years ago

I'm not associated with the Tmds.Libc project. Perhaps, you should raise an issue there.

queequac commented 5 years ago

I was not talking about the nuspec configuration for Tmds.Lib but for your project. In this case net-mdns would not reference Tmds.Lib on platforms where it is not needed anyway.