We have a server application that runs as a Console Application and it has all been working great with 3.x version of XSockets. We are currently upgrading to 4.0 to benefit from the improved binary messaging.
At the moment we have everything building with the new 4.0 assemblies but can't get the server to start and are getting the following;
System.InvalidOperationException - Sequence contains no matching element
When calling...
m_xserver = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); <--- Exception happening here.
m_xserver.Start();
foreach (var server in m_xserver.Servers)
{
LOG.DEBUG("XSocket Server {0}", server.ConfigurationSetting.Endpoint);
}
We have checked and double check the Nuget references and compared the files in the output directory. We do have the server code in a DLL that gets called from the EXE but it all worked before moving.
If I "Continue" on the exception I get a stack over flow error after a few seconds.
In a bid to discover what (if any) DLL or Class is causing the issue I put the above code it the beginning of Mani() and commented out everything else. The app still fails in the same way. However if I start to delete the now not required DLLs from the build folder (starts with 102 files of DLL/XML/PDB) then it will start to work when I get to around 21 to 25 DLL files left. This seems very strange as I've tried to vary the deleted files as best I can and a different combination will still allow it to work at around the same number of files!!
Is there a limit to the number of files the Plugin Framework can handle?
I took a deeper look at the files causing this by copying them one by one to a known working XSockets 4.0 Console App. It turns out that a mixture of my DLLs and third party DLLs somehow make the Plugin framework crash. These are..
A number of my own custom DLLs
GalaSoft.MvvmLight.Extras.WPF45.dll
MahApps.Metro.dll
Microsoft.AspNet.SignalR.Client.dll
Microsoft.AspNet.SiganlR.Core.dll
Microsoft.Owin.dll
Microsoft.Owin.Security.dll
RazorEngine.dll
System.Net.Http.Formatting.dll
System.Web.Http.dll
System.Web.Http.SelfHost.dll
System.Windows.Interactivity.dll
Even an unmanaged DLL from Truen TVSN.dll causes the stack overflow to happen.