سؤال

We're running with a remoting setup that uses the following config file.

 <application>
    <service>
      <wellknown mode="Singleton" type="NameSpace.ProjectNameSpace.ProjectPartNameSpace.ObjectA, ProjectPartName" objectUri="iObjectA.rem" />
      <wellknown mode="Singleton" type="NameSpace.ProjectNameSpace.AnotherProjectPartNameSpace.ObjectB, AnotherProjectPartName" objectUri="iObjectB.rem" />
    <service>
 <application>

This is working fine as long as the Projects actually contain the given Objects (ObjectA and ObjectB) when the client calls the Remoting object.

Question

Is there an easy way to check if the remoting objects actually exist on the build/startup of the server?

In the current situation we have to wait for the clients to make a call and fail before we see the Objects do not exist.

هل كانت مفيدة؟

المحلول

I've found an 'acceptable' answer but I'm not that happy with it.

Changing the config to the following:

<system.runtime.remoting>
  <application>
   <service>
      <wellknown mode="Singleton" type="NameSpace.ProjectNameSpace.ProjectPartNameSpace.ObjectA, ProjectPartName" objectUri="iObjectA.rem" />
       <wellknown mode="Singleton" type="NameSpace.ProjectNameSpace.AnotherProjectPartNameSpace.ObjectB, AnotherProjectPartName" objectUri="iObjectB.rem" />
     <service>
  </application>
   <debug loadTypes="true"/>
 </system.runtime.remoting>

Will give a Remoting exception for all objects that do not exist into the referenced project DLL's. This will give one exception for each config line that is incorrect but in between you'll have to restart the server to get the 'next' remoting object that no longer working.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top