Re: Remoting Help Required

From: W.G. Ryan eMVP (WilliamRyan_at_NoSpam.gmail.com)
Date: 11/15/04


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


Relevant Pages

  • Is is possible to Register a DLL using a Service?
    ... I'm a Visual Basic 6 programmer and one of my programs uses a DLL to store ... the printable reports for an agency. ... What I would like to do is to create a service that will register the dll ... properly but it still only works on an administrator's account. ...
    (microsoft.public.win2000.general)
  • How do I register a DLL using a Service?
    ... I'm a Visual Basic 6 programmer and one of my programs uses a DLL to store ... the printable reports for an agency. ... What I would like to do is to create a service that will register the dll ... properly but it still only works on an administrator's account. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Outprocess library in .NET
    ... inside the caller process and have no possibility to find it's config file ... Your C# dll is an Assembly. ... If your assembly is not shadow copied, and it is not in the GAC, you can put ... You may need to register your assembly with the /codebase option for it to ...
    (microsoft.public.dotnet.framework)
  • Re: .NET dll config file
    ... the config file is really bound to the exe file. ... if you want to dedicate a given config file to a dll (and not share the ... our assemblies. ...
    (microsoft.public.dotnet.general)
  • Re: .NET dll config file
    ... > application has some other .NET dll references. ... assemblies to a separate folder you create problems because you have to tell ... So if your library is called by a "third party application" ... You cannot create a config file just for your DLL. ...
    (microsoft.public.dotnet.framework)