A user callback threw an exception. Check the exception stack - VisualCron - Forum

Community forum

Walter
2015-01-22T00:51:06Z
Hello Henrik

After latest update (7.5.2) on both client and server, the line below which used to work
vs = vc.Connect(conn, true);
now produce this error:
A user callback threw an exception. Check the exception stack and inner exception to determine the callback that failed.

Before 7.5.2 update, the application using the API has no problem connecting from any folder on any workstation or server within the network.
The app resides on a folder that includes the updated VisualCronAPI.dll and VisualCron.dll (same version as that on the server)

After 7.5.2, error occurs on any folder on any machine except on the V/Cron server in C:\Program Files (x86)\VisualCron

Output of the EXE is:
address=192.168.111.8
port=16444
username=admin
password=
A user callback threw an exception. Check the exception stack and inner exception to determine the callback that failed.


Complete code snippet:
try
{
VisualCronAPI.Server vs = new VisualCronAPI.Server();
VisualCronAPI.Client vc = new VisualCronAPI.Client();
vc.LogToFile = false;
if (vs != null)
{
VisualCronAPI.Connection conn = new VisualCronAPI.Connection();

conn.Address = "192.168.111.8";
conn.Port = 16444;
conn.UserName = "admin";
conn.PassWord = "";
conn.ConnectionType = VisualCronAPI.Connection.ConnectionT.Remote;
Console.WriteLine("address={0}\nport={1}\nusername={2}\npassword={3}", conn.Address, conn.Port, conn.UserName, conn.PassWord);
vs = vc.Connect(conn, true);
if (vs != null)
{
Console.WriteLine("connected {0}", vs.Connected);
}
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
Console.ReadKey();
Support
2015-01-22T08:30:42Z
Could you post what the Inner exception is?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Walter
2015-01-22T23:19:27Z
The inner exception came from inside the Connect() method on the API. The try statement is basically all in this test app. I initially found this error in our original database app which was running fine up until the 7.5.2 update. I created this app to investigate what this inner exception is. When I copy the database app (and this test app) into the "c:\program files (x86)\Visual Cron" folder, the Connect method executed fine. Any other folders I copied to along with the two visual cron API dlls, the Connect method fails with the "callback inner exception" error.



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
try
{
VisualCronAPI.Server vs = new VisualCronAPI.Server();
VisualCronAPI.Client vc = new VisualCronAPI.Client();
vc.LogToFile = false;
if (vs != null)
{
VisualCronAPI.Connection conn = new VisualCronAPI.Connection();

conn.Address = "192.168.111.8";
conn.Port = 16444;
conn.UserName = "admin";
conn.PassWord = "";
conn.ConnectionType = VisualCronAPI.Connection.ConnectionT.Remote;
Console.WriteLine("address={0}\nport={1}\nusername={2}\npassword={3}", conn.Address, conn.Port, conn.UserName, conn.PassWord);
vs = vc.Connect(conn, true); <----- error occurs on this line
if (vs != null)
{
Console.WriteLine("connected {0}", vs.Connected);
}
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
Console.ReadKey();
}
}
}

Support
2015-01-23T18:34:09Z
We withdraw 7.5.2. from our website because of some communication problems. We have fixed most and now have them in beta here: http://www.visualcron.co....aspx?g=posts&t=4676 

Please upgrade client and server (and any dlls you use).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top