I'm looking for some help.
I have a Mono application for Mac, developed in VS for Mac, using the currently latest updates in the VS for Mac, which include Mono Framework MDK 5.16.0.221. The app is targeting .NET Framework 4.7.1
The app accesses an SQLite DB throught EF Core, all latest packages, the problem is that things brakes if I try to add a WCF service to the app. Apparently the order between the service start and the DB context initialization is making the app to crash.
I have created this example project, which include a test case for the issue.
It works fine as it is, but if the IPC initialization is done before the DB context (Moving this line to be after this one), the failure can be reproduce.
Edit:
The issue i have detected is the order between the WCF ServiceHost is started, and the initialization of the EF DbContext is affecting the application behavior.
Initializing the ServiceHost first:
serviceHost = new ServiceHost(singletonInstance);
...
serviceHost.AddServiceEndpoint(typeof(S), new NetTcpBinding(), serviceAddress);
serviceHost.Open();
then the DbContext
var databaseProvider = new DatabaseProvider(DB_FILE);
DatabaseContext databaseContext = databaseProvider.GetConnection();
Results into an exception like System.NotSupportedException : Specified method is not supported., when using the databaseContext to access information from the DB.
Thank you