Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline msOne  
#1 Posted : Friday, September 5, 2014 6:53:53 AM(UTC)
msOne

Rank: No customer

Joined: 8/20/2014(UTC)
Posts: 5
Australia
Location: SOUTH AUSTRALIA, ADELAIDE

Hi;

I seem to crash (or break) VC when I execute the below code..

Code:
        
Dim c As New VisualCronAPI.Connection
Dim connection As New VisualCronAPI.Connection With {.ConnectionType = VisualCronAPI.Connection.ConnectionT.Remote, .Address = "smallappstest", .Port = 16444, .UseADLogon = True}
Dim Client As New VisualCronAPI.Client
Dim MyServer As VisualCronAPI.Server = Client.Connect(connection, True)
Dim Job As New JobClass With {.Name = "Test3", .TimeOut = New TimeOutClass With {.Minutes = 5, .Use = True, .ConsiderError = True}}
Dim Tasks2 As New TaskClass
Tasks2.Name = "Taskname"
Job.Tasks.Add(Tasks2)
MyServer.Jobs.Add(Job)


VC is returning the below after about 10 sec

System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
at VisualCronAPI.Jobs.Contains(String strJobId)
at frmMain2.LGOFIHDBKKNMKLGKEDAMKMHJDNAHAMGLGILI(Server& , JobClass , TaskClass ) in C:\sourcefiles\code\VisualCron\Main\frmMain2.vb:line 1935


I have added / removed / imported / generally playing around / so I am wondering if there could be a relation?

Upon VC restart, the application will display the same error again.


And also... does my code seem to be correct??



Thanks, Martin

Edited by moderator Monday, September 8, 2014 6:50:35 AM(UTC)  | Reason: Additional information

Offline ErikC  
#2 Posted : Friday, September 5, 2014 7:29:38 AM(UTC)
ErikC

Rank: Paid support

Joined: 2/26/2008(UTC)
Posts: 1,437
Netherlands
Location: Amsterdam

Thanks: 95 times
Was thanked: 187 time(s) in 163 post(s)
Hi Martin,

and from which line is this error comming?
Looks to me that you did not fill in all the required parameters to create a job.

Regards,
Erik
Uses Visualcron since 2006.
Offline Support  
#3 Posted : Friday, September 5, 2014 7:52:09 AM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,412

Thanks: 573 times
Was thanked: 326 time(s) in 314 post(s)
Sounds like the problem is about the Task. Try replacing:

Dim Tasks2 As TaskClass = Job.NewTask
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline msOne  
#4 Posted : Friday, September 5, 2014 7:57:20 AM(UTC)
msOne

Rank: No customer

Joined: 8/20/2014(UTC)
Posts: 5
Australia
Location: SOUTH AUSTRALIA, ADELAIDE

Hi;

The error is not coming from any line at all. The code executes fine and completes with no warning.

After about 15 sec VisualCron returns the error message.

I am reinstalling VisualCron again as I could not connect to the service from client or remote server.

I'll try with the suggested code as well..

Code:

Dim Tasks2 As TaskClass = Job.NewTask 



Offline Support  
#5 Posted : Friday, September 5, 2014 8:13:13 AM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,412

Thanks: 573 times
Was thanked: 326 time(s) in 314 post(s)
This is definitely related to the Task not having the correct JobId. Your original code failed but after making my suggestions it succeeds. Here is the full code:


Code:
        Dim c As New VisualCronAPI.Connection
        Dim connection As New VisualCronAPI.Connection With {.ConnectionType = VisualCronAPI.Connection.ConnectionT.Remote, .Address = "localhost", .Port = 16444, .UseADLogon = False}
        Dim Client As New VisualCronAPI.Client
        Dim MyServer As VisualCronAPI.Server = Client.Connect(connection, True)
        Dim Job As New JobClass With {.Name = "Test3", .TimeOut = New TimeOutClass With {.Minutes = 5, .Use = True, .ConsiderError = True}}
        Dim Tasks2 As TaskClass = Job.NewTask(TaskClass.TaskT.Execute)
        Tasks2.Name = "Taskname"
        Job.Tasks.Add(Tasks2)
        MyServer.Jobs.Add(Job)
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline msOne  
#6 Posted : Monday, September 8, 2014 3:18:35 AM(UTC)
msOne

Rank: No customer

Joined: 8/20/2014(UTC)
Posts: 5
Australia
Location: SOUTH AUSTRALIA, ADELAIDE

Hi.

Thanks for your help. I am pretty sure this was related to the wrong job-id.

I have removed and reinstalled. All is working now.

Thanks,
Martin
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2016, Yet Another Forum.NET
This page was generated in 0.351 seconds.
Scroll to Top