I've got a problem. LCD Smartie hangs when I try to make a call to a .NET 2.0 dll.
I've got a set of unit tests that run fine, but no luck from LCD smartie
The plugin is for MediaPortal - it's not my plugin but I'm making some headway in getting it working. But now I'm stuck... Is there a log file somewhere for LCD smartie? I've specifed one in the config file but nothing gets written. I've also got logging turned on in my dll, and it logs just fine - but when it calls out to the other dll (that I deploy at the same time) everything just grinds to a halt
Anyone else had any problems? I've written a test .NET 2 dll and it all works fine - so I can only assume it's something to do with the dll I deploy with the plugin (ECP2Assembly.dll). Problem is, ECP2 doesn't do any logging either!
Let me know the following:
You are about to build a plugin for media portal ok?
Does the LCD Smartie complains for anything on the screen when you calling the dll?
Can you add the a simple log file to your dll to see where is the stop point?
I believe that somthing is going wrong with the dll code not from the Smartie side.
You can use something like the following to dynamically create a text file
and add a line s.WriteLine() on function beginning and on function end to your dll.
Imports System.IO 'declare namespace
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fs As New FileStream("C:\file.txt", FileMode.Create, FileAccess.Write)
'declaring a FileStream create txt file and give write access
Dim s As New StreamWriter(fs) ' file stream creation
s.BaseStream.Seek(0, SeekOrigin.End) 'move forward
s.WriteLine("Line one added.") 'Write
s.WriteLine("Code provided by limbo.") 'write
s.Close()
'closing the file
End Sub
End Class
So if you see that a function has begun but not ended there is a suspicious position on your code.
The only thing needed to make the above code working is to make public the declares.
lol. Thank you for the quick response - and the coding 101!
I'm using a standard logging framework (log4net), so I know exactly where the code fails. It's as soon as it tries to call the external dll (ECP2Assembly).
There are no exceptions thrown, as I have a try-catch block around the call. LCD Smartie just hangs
I'm not implying that I think LCD Smartie is doing anything wrong, but I know the plugin code works fine when I call it from NUnit, or from another piece of .lNET code - so I'm confused as to why it doesn't work in LCD Smartie.
I thought it could be because there was an uncaught exception being thrown (I saw a reference to it in the FAQ I think, saying an uncaught exception will cause LCD Smartie to hang) but I'm now confident it isn't that as I've wrapped the code in a try-catch for System.Exception.