I have my own .NET app (not an MP plugin) that uses the dll's from the MediaPortal source to retrieve the Scheduled recordings.
I reference TVBusinessLayer.dll in my app and then call the code shown below.
It was working perfectly in MP 1.6, since I updated the referenced DLL to 1.7 and MediaPortal itself to 1.7, I am getting an exception:
TVData Initialize EXCEPTION: The type initializer for 'Gentle.Framework.ProviderFactory' threw an exception. System.TypeInitializationException: The type initializer for 'Gentle.Framework.ProviderFactory' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Gentle.Framework.ProviderRegistry.GetProviderInfo(Assembly assembly)
at Gentle.Framework.ProviderRegistry.GetProviderInfo(String assemblyName)
at Gentle.Framework.ProviderRegistry.RegisterProvider(String name, String assembly)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Gentle.Common.MethodInvoker.Invoke(Object target, Object[] parameterValues)
at Gentle.Common.MethodDispatcher.Invoke(Object target, Hashtable parameters)
at Gentle.Common.CallbackTarget.Configure(Object target, XmlNode node)
at Gentle.Common.CallbackTarget.Configure(Object target, XmlNodeList nodes)
at Gentle.Common.ConfigurationMap.Configure(IList handlers, Object obj)
at Gentle.Common.Configurator.Configure(String configStoreName, Object instance)
at Gentle.Framework.ProviderRegistry..ctor()
at Gentle.Framework.ProviderFactory..cctor()
--- End of inner exception stack trace ---
at Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(String connectionString)
Both SetDefaultProviderConnectionString and CreateGroup throw the same exception.
The connection string is the same as in gentle.config, which works fine in MediaPortal itself.
Both MP and my app are on the same PC.
If I revert back to a previous version of my app which uses the v1.2 MP dll's it works fine again.
The DLL's references in my app was originally from MP v1.2, the TV Server was 1.6, this was working fine.
Perhaps there was a change in the dll v1.3 or higher?
I reference TVBusinessLayer.dll in my app and then call the code shown below.
It was working perfectly in MP 1.6, since I updated the referenced DLL to 1.7 and MediaPortal itself to 1.7, I am getting an exception:
TVData Initialize EXCEPTION: The type initializer for 'Gentle.Framework.ProviderFactory' threw an exception. System.TypeInitializationException: The type initializer for 'Gentle.Framework.ProviderFactory' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Gentle.Framework.ProviderRegistry.GetProviderInfo(Assembly assembly)
at Gentle.Framework.ProviderRegistry.GetProviderInfo(String assemblyName)
at Gentle.Framework.ProviderRegistry.RegisterProvider(String name, String assembly)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Gentle.Common.MethodInvoker.Invoke(Object target, Object[] parameterValues)
at Gentle.Common.MethodDispatcher.Invoke(Object target, Hashtable parameters)
at Gentle.Common.CallbackTarget.Configure(Object target, XmlNode node)
at Gentle.Common.CallbackTarget.Configure(Object target, XmlNodeList nodes)
at Gentle.Common.ConfigurationMap.Configure(IList handlers, Object obj)
at Gentle.Common.Configurator.Configure(String configStoreName, Object instance)
at Gentle.Framework.ProviderRegistry..ctor()
at Gentle.Framework.ProviderFactory..cctor()
--- End of inner exception stack trace ---
at Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(String connectionString)
Code:
tvBusinessLayer = new TvBusinessLayer();
// This code was added to test the connection string
string sConn = "Server=PC2;Database=MpTvDb;User ID=root;Password=MediaPortal;charset=utf8;Connection Timeout=30;";
Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(sConn);
// This line was the original line that threw the exception
tvBusinessLayer.CreateGroup(TvConstants.TvGroupNames.AllChannels);
Both SetDefaultProviderConnectionString and CreateGroup throw the same exception.
The connection string is the same as in gentle.config, which works fine in MediaPortal itself.
Both MP and my app are on the same PC.
If I revert back to a previous version of my app which uses the v1.2 MP dll's it works fine again.
The DLL's references in my app was originally from MP v1.2, the TV Server was 1.6, this was working fine.
Perhaps there was a change in the dll v1.3 or higher?
Last edited: