Closed borrillis closed 7 years ago
Hi @borrillis,
Since a background task is a windows runtime component it doesn't support exporting some of the features that .net offers.
I think there's two options to solve the above issue:
make the DebugLogFactory internal or private so that it won't be included in the interface for the windows runtime component and thus won't be "an exported type"
create a separate regular DLL with the rest server in it and reference that from the background task.
Hope this helps,
Jark
Hi Jark, I ended up solving it using option 2 since I needed the class library for EFCore.
Thanks.
When i implemented the classes according to the wiki : https://github.com/tomkuijsten/restup/wiki/Logging in a UWP BackgroundTask project, I get build errors like :
Error Type 'DebugLogFactory' implements interface 'Restup.WebServer.Logging.ILogFactory', which is not a Windows Runtime interface. All interfaces that are implemented by exported types must be Windows Runtime interfaces.
Error Method 'DebugLogFactory.GetLogger(System.String)' returns 'Restup.WebServer.Logging.ILogger', which is not a valid Windows Runtime type. Methods exposed to Windows Runtime must return only Windows Runtime types.
Error 'DebugLogFactory.GetLogger<T>()' is a generic method. Windows Runtime methods cannot be generic.
Error Windows Runtime class 'DebugLogger' has an invalid base type, 'Restup.WebServer.Logging.AbstractLogger'. Classes must derive either from System.Object or from a composable Windows Runtime class. Implementation inheritance is not allowed.