Question Using a dynamic assembly

Buffy

New member
Joined
May 26, 2010
Messages
2
Programming Experience
3-5
I'm using the following code to create a dynamic assembly in my service:

VB.NET:
Dim currApp As String = Application.ExecutablePath
                            currApp = currApp.Replace("OBJ_SRV.EXE", "SCS_Unix2Acs.dll")
                            Dim loadAssembly As [Assembly] = Nothing
                            loadAssembly = [Assembly].LoadFrom(currApp)
                            Dim obj As Object
                            obj = loadAssembly.CreateInstance("SCS_Unix2Acs.uUnix2Acs")

                            'Dim obj As New SCS_Unix2Acs.uUnix2Acs
                            obj.BckCnPath = serv.Bck
                            obj.UnixPath = serv.Xtr1
                            obj.LogPath = serv.Log
                            serv.SrvObj = obj
                            serv.SrvObj.StartService()

This works perfectly in debug mode but when I run my service I get the following error: Object variable or With block variable not set.
Can someone help me?
 
Back
Top