Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / August 2005

Tip: Looking for answers? Try searching our database.

Remoting and COM+

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian Harding - 09 Aug 2005 11:41 GMT
I have a COM+ application, which acts as a remoting server.  The .NET
assembly contains two COM visible objects - one is trigger by a service
to load a config file and start listening for remoting clients, the
other is used in remoting calls (there is another object which is the
actual remoting component because it seems a class cannot be a remoted
object and serviced component).

For installation, I use regasm /codebase, then gacutil to register the
.NET assembly, then regsvcs to add the components to the COM+
application (it's an existing application).

On one server, this is enough, and clients can create and make use of
the remoted object.  On another server (both are Windows 2003, no SP),
the remoting configuration object reports a successful start, but
clients are unable to use the remoted object.  Instead an exception is
thrown indicating that my assembly or one of its dependencies was not found.

The fact that I have used regasm /codebase _or_ GACed the assembly and
all of its dependencies should mean there won't be a problem.  I added
the folder storing the assembly and dependencies to the system path -
still no joy.  In desperation I put the assembly and dependencies into
the Windows\System32 folder - suddenly it started working.

I have checked and double checked that all file versions match between
the two servers and all clients.  I removed the application files and
configuration from both servers and started from scratch, one step at a
time, copying exactly what I did on both machines.  Still the same
situation - on one server the application will not work unless all of
the .NET files are in Windows\System32!

I don't understand what's going on.  Please can someone help!

Thank you
Ian
Ian Harding - 10 Aug 2005 10:25 GMT
> I have a COM+ application, which acts as a remoting server.  The .NET
> assembly contains two COM visible objects - one is trigger by a service
[quoted text clipped - 31 lines]
> Thank you
> Ian

I've worked it out.  The remoting configuration file needs to specify
the assembly version, culture, and public key in order to load the
assembly from the GAC.

For example, this is what I started with, that didn't work:

  <system.runtime.remoting>
    <application name="EngineSupport">
      <service>
        <wellknown mode="SingleCall"
          type="<remote class>,<assembly name>"
          objectUri="<uri>" />
      </service>
      <channels>
        ...
      </channels>
    </application>
  </system.runtime.remoting>

This is what I had to change it to:

  <system.runtime.remoting>
    <application name="EngineSupport">
      <service>
        <wellknown mode="SingleCall"
         type="<remote class>,<assembly
name>,Version=<x.x.x.x>,Culture=<culture>,PublicKeyToken=<key>"
          objectUri="<uri>" />
      </service>
      <channels>
        ...
      </channels>
    </application>
  </system.runtime.remoting>

I don't understand why this is necessary.  Surely if I don't specify
version, culture, key then _any_ assembly that matches the specified
name and contains the requested class should be loaded from the GAC.

This is certainly going to be an inconvenience for customers to have to
change version numbers in their configuration files every time we
release a new version.

Ian

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.