Re: Remoting Help Required
From: W.G. Ryan eMVP (WilliamRyan_at_NoSpam.gmail.com)
Date: 11/15/04
- Next message: Jay B. Harlow [MVP - Outlook]: "Re: Character Substitution- a solution"
- Previous message: Tales Normando: "Fastest way to save an array of doubles on disk?"
- In reply to: Mark: "Remoting Help Required"
- Next in thread: Mark: "Re: Remoting Help Required"
- Reply: Mark: "Re: Remoting Help Required"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 14 Nov 2004 21:43:34 -0500
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:uDUbC0pyEHA.2568@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
- Next message: Jay B. Harlow [MVP - Outlook]: "Re: Character Substitution- a solution"
- Previous message: Tales Normando: "Fastest way to save an array of doubles on disk?"
- In reply to: Mark: "Remoting Help Required"
- Next in thread: Mark: "Re: Remoting Help Required"
- Reply: Mark: "Re: Remoting Help Required"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|