I have a Windows Service with the following configuration in the app.config:
<configuration>
<system.runtime.remoting>
<application name="RemoteHostService">
<service>
<wellknown type="Telefonica.Morosos.BusinessLogic.Facade.Agencia,
Telefonica.Morosos.BusinessLogic.IFacade"
objectUri="Morosos.Agencia"
mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="8085">
<serverProviders>
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
The first question is : My Remotable class is:
Telefonica.Morosos.BusinessLogic.Facade.Agencia
I distribute only the Interface called: IAgencia which is in the assembly:
Telefonica.Morosos.BusinessLogic.IFacade
Is the following ok?
<wellknown type="Telefonica.Morosos.BusinessLogic.Facade.Agencia,
Telefonica.Morosos.BusinessLogic.IFacade"
objectUri="Morosos.Agencia"
mode="Singleton" />
Second Question: Do I need to add a reference in my windows service project
to both Projects:
Telefonica.Morosos.BusinessLogic.Facade and
Telefonica.Morosos.BusinessLogic.IFacade
?
Third question:
In My Web Aapplication (Client) I have the following in the Globla.asax:
protected void Application_Start(Object sender, EventArgs e)
{
RemotingConfiguration.Configure(Server.MapPath("Remoting.config"));
}
In Remoting.Config I have:
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" />
</channels>
<client>
<wellknown type="IAgencia, Telefonica.Morosos.BusinessLogic.IFacade"
url="tcp://localhost:0/Morosos.Agencia" />
</client>
</application>
</system.runtime.remoting>
</configuration>
And I use a class from here:
http://www.thinktecture.com/Resources/RemotingFAQ/USEINTERFACESWITHCONFIGFILES.html So I get the following code in my Page_Load event:
IAgencia obj = (IAgencia) RemotingHelper.GetObject(typeof(IAgencia));
After all. I receive the following error:
Type not found!
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Runtime.Remoting.RemotingException: Type not found!
Source Error:
Line 17: if (entr == null)
Line 18: {
Line 19: throw new RemotingException("Type not found!");
Line 20: }
So anyone can tell me? What's going on?
--
--
Este mensaje no implica responsabilidad alguna.
--
José Manuel
Programador