all groups > dotnet remoting > july 2004 >
You're in the

dotnet remoting

group:

Remote Object Not Found When Service Installed with Setup Project


Re: Remote Object Not Found When Service Installed with Setup Project Sam Santiago
7/30/2004 5:48:57 PM
dotnet remoting:
Try something simpler when setting the configuration path as a test. Try
something like:

RemotingConfiguration.Configure(AppDomain.CurrentDomain.FriendlyName +
".config")

or simply hard coding it as a test:

RemotingConfiguration.Configure("myservice.exe.config")



Thanks,


Sam


--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTechture.com
_______________________________
[quoted text, click to view]

Remote Object Not Found When Service Installed with Setup Project Jim Davis
7/31/2004 12:37:44 AM
I have a simple remote object that is hosted in a Windows Service. I
register the WellKnownType via the services app.config file. I look up the
path to that file using
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), then pass
that to RemotingConfiguration.Configure(path).

It all works fine when I install the Windows service using InstallUtil, but
when I create a Setup Project for the service I get a "File or assembly name
XX, or one of its dependencies, was not found."

The remote object is available - I have a test harness that can invoke it
directly with no errors. The app.Config file is visible to the service, as
I can read other keys from app settings. I have trace code that writes the
path of the file used in RemotingConfiguration.Configure() to the EventLog,
and it is correct.

I do not want to put the config file in system32, I want it next to the
service exe. Is there a way of doing this?

My config section and Activator.GetObject call are below.

Thanks,

Jim


My config section is:

<system.runtime.remoting>
<application name="RatingEngineService">
<service>
<wellknown type="Comp.RatingEngineRemote.IIE_Statement,
RatingEngineRemote"
objectUri="RatingEngineRemote"
mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="9999">
<serverProviders>
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>


The objects are invoked with the following code.

IIIE_Statement stmt = (IIIE_Statement)Activator.GetObject(
typeof(Comp.IRatingEngineRemote.IIIE_Statement),
tcp://server:9999/RatingEngineRemote);



Re: Remote Object Not Found When Service Installed with Setup Project Jim Davis
8/3/2004 5:38:47 PM
False alarm.

The problem was that my remote assembly was in the gac, and my config file
did not specify version, culture and public key info for the <wellknown>
type attribute. All prior testing had been done with the service.exe in the
same folder as the remote object's dll, so it was finding it. When the
service.exe was installed from another folder, even using InstallUtil.exe, I
got the same error.



[quoted text, click to view]

AddThis Social Bookmark Button