exception while open connection to TVServer (1 Viewer)

nu_81

Portal Pro
November 15, 2009
315
74
Rheinberg
Home Country
Germany Germany
Hello,
I try to realise my first MediaPortal Project and have an issue while coding the first lines.
I will connect from a 3rd Service class to the TV Service with the following code:

RemoteControl.HostName = "localhost";
//get the location of the database..

string connStr;
string provider;
IController controller = RemoteControl.Instance;
controller.GetDatabaseConnectionString(out connStr, out provider);

//set the connection string
ProviderFactory.SetDefaultProviderConnectionString(connStr);
In the last line I get an exception. Unfortunally I got it in german, but I hope you can read some information on that:

System.TypeInitializationException wurde nicht behandelt.
Message=Der Typeninitialisierer für "Gentle.Framework.ProviderFactory" hat eine Ausnahme verursacht.
Source=Gentle.Framework
TypeName=Gentle.Framework.ProviderFactory
StackTrace:
bei Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(String connectionString)
bei ConsoleApplication1.Program.Main(String[] args) in C:\Users\xxx\Desktop\MP\TVAnytime\Test\ConsoleApplication1\ConsoleApplication1\Program.cs:Zeile 34.
bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Reflection.TargetInvocationException
Message=Ein Aufrufziel hat einen Ausnahmefehler verursacht.
Source=mscorlib
StackTrace:
bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
bei Gentle.Common.MethodInvoker.Invoke(Object target, Object[] parameterValues)
bei Gentle.Common.MethodInvokable.Invoke(Object target)
bei Gentle.Common.MethodDispatcher.Invoke(Object target, Hashtable parameters)
bei Gentle.Common.CallbackTarget.Configure(Object target, XmlNode node)
bei Gentle.Common.CallbackTarget.Configure(Object target, XmlNodeList nodes)
bei Gentle.Common.ConfigurationMap.Configure(IList handlers, Object obj)
bei Gentle.Common.Configurator.Configure(String configStoreName, Object instance)
bei Gentle.Common.Configurator.Configure(Object instance)
bei Gentle.Framework.ProviderRegistry..ctor()
bei Gentle.Framework.ProviderFactory..cctor()
InnerException: System.Reflection.ReflectionTypeLoadException
Message=Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft ab, wenn Sie weitere Informationen benötigen.
Source=mscorlib
StackTrace:
bei System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
bei System.Reflection.Assembly.GetTypes()
bei Gentle.Framework.ProviderRegistry.GetProviderInfo(Assembly assembly)
bei Gentle.Framework.ProviderRegistry.GetProviderInfo(String assemblyName)
bei Gentle.Framework.ProviderRegistry.RegisterProvider(String name, String assembly)
InnerException:
I also tried to post this in the german section, but I got no answer.

Thank you in advance.
Nu
 

nu_81

Portal Pro
November 15, 2009
315
74
Rheinberg
Home Country
Germany Germany
Hello,
Where can I get some support for my issue?
Is there any other section or Forum for my kind of question?
I have an idea for a MePo extension and for now I'm very motivated to realize it.
I would be very thankful for any idea.
Ciao Nu
 

mm1352000

Development Group
  • Team MediaPortal
  • September 1, 2008
    21,577
    8,222
    Home Country
    New Zealand New Zealand
    Country flag
    Hello

    Here is an okay place for this question.
    I think it would be good if you could explain exactly what you're trying to do, because in general it would be better if you could let the TV service handle the database connection and use the TVDatabase.dll and TvBusinessLayer.dll to access the data you need. If you need to use custom queries then it makes sense to have your own connection.

    To directly address the problem...
    For a start, make sure you have the Gentle.NET provider DLLs in the right place. You need all of the following DLLs:
    Gentle.Common.dll
    Gentle.Framework.dll
    Gentle.Provider.MySQL.dll
    Gentle.Provider.SQLServer.dll
    MySql.Data.dll

    I'm not sure exactly what is going wrong, but since Gentle.NET is open source I would suggest to check the source code to work out why the exception is being thrown. The source code is here:
    https://github.com/MediaPortal/MediaPortal-1/blob/master/Common-MP-TVE3/External/Gentle.NET/Source/
    https://github.com/MediaPortal/Medi...urce/Gentle.Framework/Core/ProviderFactory.cs

    I hope that helps at least a little.

    mm
     

    nu_81

    Portal Pro
    November 15, 2009
    315
    74
    Rheinberg
    Home Country
    Germany Germany
    Hello,
    Thank you for your reply.
    My goal is to create a service which read the EPG of a selected channel, qualify every entry (imdb rating, Already recorded, etc) and to mark selective Programs for recording.
    So new, good Movies will be automaticly recorded on the main paytv channels.
    This service should work in the background every x days. Further I would like to create a Webservice to manage the selected recording marks and programs which could not be qualified. this should work by a Webbrowser and in future by a MePo PlugIn.
    At the beginning there would by much movies to deselect as "already recorded/ already seen" but in future it should be very helpful to me.

    My idea is to create a dll which can be used by my services.


    I read that there are 2 possibilIties to do that.
    1) to use a TV Plugin (I guess that in this case i am not able to use it by my services)
    2) to connect to the TV Service with Gentle.net

    How can I connect to the TV Service by Tvdatabase.dll ?

    Thank you in advance.
    Nu
     
    Last edited:

    nu_81

    Portal Pro
    November 15, 2009
    315
    74
    Rheinberg
    Home Country
    Germany Germany
    So,
    I don't know why but after copying the dll from my real HTPC to the devolopment maschine now it working.
    The problem occured also when I try to connect by TvBusinessLayer.dll. The reason should b because it also uses then Gentle.Framework.
    So now it works and thank you again.
     

    Users who are viewing this thread

    Similar threads

    Same issue. Uninstalling & reinstalling worked for me as well. I did delete the folder tree, but looking beforehand showed that there were no files left after the uninstall & reboot.
    Same issue. Uninstalling & reinstalling worked for me as well. I did delete the folder tree, but looking beforehand showed that...
    I just upgraded from MP2 2.2.3 to MP2 2.3 and now my clients start, show the splash screen, and then don't move any further. Is it...
    Replies
    7
    Views
    1K
    Du weißt doch wie das ist mit dem Wald vor lauter Bäumen..... gefunden Danke
    Du weißt doch wie das ist mit dem Wald vor lauter Bäumen..... gefunden Danke
    Not sure if this is the right forum to post or not so apologies if this is out of context. I am trying to get TVServerKodi plugin...
    Replies
    25
    Views
    8K
    The only custom location I did was changing the default C:/TEMP folder of windows to Z:/TEMP to avoid writings on my SSD.
    The only custom location I did was changing the default C:/TEMP folder of windows to Z:/TEMP to avoid writings on my SSD.
    Today I unplug my TVServer for cleanup routine and when I plug it back, I'm not able to connect to my TVserver since. Can someone...
    Replies
    8
    Views
    1K
    My app is in the same location, nothing has changed. I code the app on another PC and copy and overwrite the EXE and DLL's over to the TV PC. If I copy over the previous EXE and v1.2 TvEngine3 DLL's the TvBusinessLayer works fine again. Configuration has not changed at all except for the updated DLL references. gentle.config is in the...
    My app is in the same location, nothing has changed. I code the app on another PC and copy and overwrite the EXE and DLL's over to...
    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...
    Replies
    6
    Views
    2K
    Well as the log say. What can the problem be with my system? Action start 6:02:24: PrepareXmlPathVariables. SFXCA: Extracting custom action to temporary directory: C:\Users\Oldage_2\AppData\Local\Temp\MSI7BDF.tmp-\ SFXCA: Binding to CLR version v4.0.30319 Calling custom action...
    Well as the log say. What can the problem be with my system? Action start 6:02:24: PrepareXmlPathVariables. SFXCA: Extracting...
    Well as the log say. What can the problem be with my system? Action start 6:02:24: PrepareXmlPathVariables. SFXCA: Extracting...
    Replies
    0
    Views
    1K
    Top Bottom