- July 24, 2005
- 104
- 3
- Home Country
- Sweden
I'm trying to connect and access the tv-server remotely using this simple piece of code:
But it throws an error, any ideas what I might have missed?
Code:
try
{
String provider;
String connectionString;
RemoteControl.Instance.GetDatabaseConnectionString(out connectionString, out provider);
ProviderFactory.SetDefaultProviderConnectionString(connectionString);
}
catch (Exception ex)
{
MessageBox.Show("Failed to connect to host.\r\n\r\n" + ex.Message);
return;
}
IList channels = Channel.ListAll();
for (int i = 0; i < channels.Count; ++i)
{
comboBoxChannels.Items.Add(channels[i]);
}
But it throws an error, any ideas what I might have missed?
System.TypeInitializationException: The type initializer for 'Gentle.Framework.ProviderFactory' threw an exception. ---> Error: NoConfigStoreFoundUnclassified
Gentle.Common.GentleException: FATAL ERROR: No configuration store was found!
Gentle is unable to continue!
The handlers emitted the following error messages:
Unable to create GentleSectionHandler for section named "gentle" in file "F:\Visual Studio 2008\Projects\MediaPortal TVClient\MediaPortal TVClient\bin\Debug\MediaPortal TVClient.vshost.exe.config".
Unable to create FileHandler for file Gentle.config.
This usually means that the file could not be found in any of the default search locations.
The handlers threw the following exceptions:
Error: DeveloperErrorUnclassified
Gentle.Common.GentleException: No configuration file could be located.
at Gentle.Common.FileHandler..ctor(String file)
at Gentle.Common.Configurator.AddFileHandler(String configStoreName, String fileName)
at Gentle.Common.Configurator.InitializeHandlers()
at Gentle.Common.Configurator.Configure(String configStoreName, Object instance)
at Gentle.Common.Configurator.Configure(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)
at MediaPortal_TVClient.Form1.buttonConnect_Click(Object sender, EventArgs e) in F:\Visual Studio 2008\Projects\MediaPortal TVClient\MediaPortal TVClient\Form1.cs:line 33