M
Mark
Hi,
I was wondering if anyone could point me in the right direction here.
I've got a remote object that controls the dataset generation for our
system reports. This all works fine at the moment as everything is in
the same directory.
Now I have a request to run multiple versions of the reports on the
single server, i.e. live prod version and latest test version.
The code I currently use is this, although this is cut down.
----------------------------------------------------------------------
If File.Exists(oFileInfo.DirectoryName & "\" & sAssemblyName & ".dll") Then
oAppDomain = AppDomain.CreateDomain(Guid.NewGuid().ToString)
oObjectHandle = oAppDomain.CreateInstance( _
sAssemblyName, _
sAssemblyName & ".cls" & ReportCorrelation & "DataSet", _
False, _
BindingFlags.CreateInstance, _
Nothing, Nothing, Nothing, Nothing, Nothing)
If Not IsNothing(oObjectHandle) Then
oReportDataSet =
oObjectHandle.Unwrap().BuildDataSet(ReportXML, ParametersHashtable,
VariablesHashtable, RuntimeHashtable, BreakGroups)
End If
End If
----------------------------------------------------------------------
The code I'm attemting to change this too is:
----------------------------------------------------------------------
If File.Exists(oFileInfo.DirectoryName & "\" & ReportVersion & "\" &
sAssemblyName & ".dll") Then
oAppDomain = AppDomain.CreateDomain(Guid.NewGuid().ToString,
Nothing, oFileInfo.DirectoryName, "", False)
oAppDomain.AppendPrivatePath(ReportVersion)
oObjectHandle = oAppDomain.CreateInstance( _
sAssemblyName, _
sAssemblyName & ".cls" & ReportCorrelation & "DataSet", _
False, _
BindingFlags.CreateInstance, _
Nothing, Nothing, Nothing, Nothing, Nothing)
If Not IsNothing(oObjectHandle) Then
oReportDataSet =
oObjectHandle.Unwrap().BuildDataSet(ReportXML, ParametersHashtable,
VariablesHashtable, RuntimeHashtable, BreakGroups)
End If
End If
----------------------------------------------------------------------
As you can see, the only real difference here is an expansion of the
CreateDomain call to include a base directory and telling it what
version of the reporting to run.
For some reason the second piece of code results in the following
exception - Public member 'BuildDataSet' on type 'MarshalByRefObject'
not found.
Can anyone help me out here please? I've 'googled' the exception, but
there's not a great deal out there.
Thanks!
Mark
I was wondering if anyone could point me in the right direction here.
I've got a remote object that controls the dataset generation for our
system reports. This all works fine at the moment as everything is in
the same directory.
Now I have a request to run multiple versions of the reports on the
single server, i.e. live prod version and latest test version.
The code I currently use is this, although this is cut down.
----------------------------------------------------------------------
If File.Exists(oFileInfo.DirectoryName & "\" & sAssemblyName & ".dll") Then
oAppDomain = AppDomain.CreateDomain(Guid.NewGuid().ToString)
oObjectHandle = oAppDomain.CreateInstance( _
sAssemblyName, _
sAssemblyName & ".cls" & ReportCorrelation & "DataSet", _
False, _
BindingFlags.CreateInstance, _
Nothing, Nothing, Nothing, Nothing, Nothing)
If Not IsNothing(oObjectHandle) Then
oReportDataSet =
oObjectHandle.Unwrap().BuildDataSet(ReportXML, ParametersHashtable,
VariablesHashtable, RuntimeHashtable, BreakGroups)
End If
End If
----------------------------------------------------------------------
The code I'm attemting to change this too is:
----------------------------------------------------------------------
If File.Exists(oFileInfo.DirectoryName & "\" & ReportVersion & "\" &
sAssemblyName & ".dll") Then
oAppDomain = AppDomain.CreateDomain(Guid.NewGuid().ToString,
Nothing, oFileInfo.DirectoryName, "", False)
oAppDomain.AppendPrivatePath(ReportVersion)
oObjectHandle = oAppDomain.CreateInstance( _
sAssemblyName, _
sAssemblyName & ".cls" & ReportCorrelation & "DataSet", _
False, _
BindingFlags.CreateInstance, _
Nothing, Nothing, Nothing, Nothing, Nothing)
If Not IsNothing(oObjectHandle) Then
oReportDataSet =
oObjectHandle.Unwrap().BuildDataSet(ReportXML, ParametersHashtable,
VariablesHashtable, RuntimeHashtable, BreakGroups)
End If
End If
----------------------------------------------------------------------
As you can see, the only real difference here is an expansion of the
CreateDomain call to include a base directory and telling it what
version of the reporting to run.
For some reason the second piece of code results in the following
exception - Public member 'BuildDataSet' on type 'MarshalByRefObject'
not found.
Can anyone help me out here please? I've 'googled' the exception, but
there's not a great deal out there.
Thanks!
Mark