mrwebrtc assembly not found in Xamarin.Forms
I'm trying to create mobile based video surveillance app, where host (sender) is in win form (core) application. Previously I have create client (recover) in win form (core) which is working fine, but same code is giving exception in Xamarin.Forms in both Android and iOS.
Initialize Peer Connection (Working fine)
_peerConnection.InitializeAsync(new PeerConnectionConfiguration()).ContinueWith((t) =>
{
_peerConnection.LocalSdpReadytoSend += _peerConnection_LocalSdpReadytoSend;
});
On Web Socket Message Received (Giving exception)
_peerConnection.SetRemoteDescriptionAsync(new SdpMessage
{
Content = obj["offer"],
Type = SdpMessageType.Offer
}).ContinueWith((t) => {
if (_peerConnection.CreateAnswer()) {
}
});
Getting exception in SetRemoteDescriptionAsync method
{System.DllNotFoundException: mrwebrtc assembly:
As the error indicates, mrwebrtc.dll was not deployed correctly. Might be related to #634, since this was fixed but we didn't respin any new NuGet packages with that fix.
Best way to find out is try copying the DLL manually and see if that solves the issue. If it does then it's a deployment issue. If it doesn't then that's a more complex issue where the DLL is possibly missing dependencies so cannot load. Some tools like https://github.com/lucasg/Dependencies might help figuring out which DLL is missing.
@djee-ms, thanks for replying, If this is missing dll issue then how Peer Connection getting initialize?
_peerConnection.InitializeAsync(new PeerConnectionConfiguration()).ContinueWith((t) =>
{
_peerConnection.LocalSdpReadytoSend += _peerConnection_LocalSdpReadytoSend;
});
Above code is not giving any exception but while SetRemoteDescriptionAsync I'm getting DllNotFoundException: mrwebrtc
I have tried manually putting putting dll's, but that also didn't help
After checking project I got this: // Note that on Windows due to a "bug" in LoadLibraryEx() this filename must not contain any '.'. // See https://github.com/dotnet/runtime/issues/7223 internal const string dllPath = "mrwebrtc";
Sorry I missed some part:
same code is giving exception in Xamarin.Forms in both Android and iOS.
Android is only supported via Unity, not via the direct C# .NET Core library, and iOS is not supported at all. So this was never tested, and I have no idea how Xamarin works with regard to DllImport, nor what is happening here.
We can continue to discuss about this issue but I am tagging it as Invalid because this is outside of the scope of supported platforms. I also have no knowledge about Xamarin so I doubt I can be of any help.