Using Rhino 4 Plugin in Rhino 5 32 bit

Hello Gyus.

when i tried to load the Rhino 4 plugin in Rhino 5 32 bit. At the first load it runs OK but when i closes rhino 5 and restarts it it gives me an Errors.

pls check the attached image.

Which plug in?

Plugin i created using VB.net.

I just found that it gives an error when i add the reference for Rhino 4 script library.
and uses this code
Public Class UserControl1

Public obj As Object = RhUtil.RhinoApp.GetRhinoScriptInterface()

Public RScript As RhinoScript4.IRhinoScript = CType(obj, RhinoScript4.IRhinoScript)


Public Sub New()
    ' This call is required by the Windows Form Designer.
    InitializeComponent()

End Sub

Public Shared Function BarID() As Guid
    Dim g As New Guid("{45A2D5CD-CC07-4ab6-8C74-00ED4F416924}")
    Return g
End Function

Private Sub UserControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

End Class

When i use any Rscript. command in UserControl1_Load it gives an Error.

Like If I use under button click event, it works fine

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim arrPlane = RScript.WorldXYPlane

    RScript.AddCircle(arrPlane, 5.0)

End Sub

But If i use under plugin_Load event is gives those Errors

Private Sub UserControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    Dim arrPlane = RScript.WorldXYPlane


    RScript.AddCircle(arrPlane, 5.0)

End Sub

Resolved.

I was using the Script object under load event. that was giving me an error in Rhino 5.0.
So i shifted that code so it will run after loading event.

Thank you guys for your replies.