473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Remoting Help Required

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
Nov 21 '05 #1
2 1018


The way you're approaching it definitely isn't the easy way. You can use a
..config file, register it as a well known type and as long as it's in the
bin directory of the Remoting Server you're good to go. This means that you
can have the same .dll running on 20 different boxes and have 20 different
instances of your app out there pointing to a separate instance of that dll.
Not saying that you'd want to but I'm just mentioning it for the sake of
illustration.

You don't need to .dll at all on the client machine and by hosting it on a
machine that's running your remoting server as a service or using IIS - then
you can just stick everything there- register it in the config file and
you're gold.
http://www.knowdotnet.com/articles/goingremotei.html

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Mark" <m@ark.com> wrote in message
news:uD**************@TK2MSFTNGP11.phx.gbl...
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

Nov 21 '05 #2
W.G. Ryan eMVP wrote:
The way you're approaching it definitely isn't the easy way. You can use a
.config file, register it as a well known type and as long as it's in the
bin directory of the Remoting Server you're good to go. This means that you
can have the same .dll running on 20 different boxes and have 20 different
instances of your app out there pointing to a separate instance of that dll.
Not saying that you'd want to but I'm just mentioning it for the sake of
illustration.

You don't need to .dll at all on the client machine and by hosting it on a
machine that's running your remoting server as a service or using IIS - then
you can just stick everything there- register it in the config file and
you're gold.
http://www.knowdotnet.com/articles/goingremotei.html

The problem is I'm stuck with this particular monkey on my back, and
can't work out why the almost identical second piece of code doesn't run.

Would you have any pointers or ideas that might explain the two
CreateDomain calls acting differently?

Mark
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Uma Vivek | last post by:
Hi, I have a problem with Flash remoting via .NET . I seem to have all the code right, but flash does not seem to display the data at all. Here's is what Ive done so far... (1) Ive...
1
by: Algirdas | last post by:
Hy, I want to use object remoting in my project, but faced some problems. I can’t find System.Runtime.Remoting.Channels.Tcp and System.Runtime.Remoting.Channels.Http namespaces. I guess I...
12
by: Mural Kumar via .NET 247 | last post by:
(Type your message here) -------------------------------- From: Mural Kumar Which is the best way to make a remoting server? 1)As a Windows service 2)As a simple exe, which will run in a...
5
by: LGHummel | last post by:
I'm trying to host a remoting app in IIS and am getting the following error: Failed to execute the request because the ASP.NET process identity does not have read permissions to the global...
13
by: Ron L | last post by:
I am working on an application that is a front-end for a SQL database. While it is not an immediate requirement, the application will probably be required to be able to connect via the internet at...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
5
by: mitch | last post by:
Hello, Basically, I want my application to run only one instance at a time and pass command line arguments to a running instance. I have all of this working, I used the IPC Remoting channel and...
3
by: Michael Maes | last post by:
Hi, We have a windows service passing objects to a client application by remoting. The windows service is started and running successfully. * When the client app is running on the same...
4
by: Rich | last post by:
Can anyone suggest a good (current) tutorial on how to do basic remoting with C# (2005 express edition)?
6
by: AAAAA | last post by:
Is WCF better than Net remoting?? What are the adventages of WCF?? Thank you Cesar
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.