Article ID: 323490 - Last Review: December 3, 2007 - Revision: 4.4 INFO: Configure .NET Remoting When the Remoting Client Is an ASP.NET Application or the Client Is Another Remoted Component That Is Hosted by IISThis article was previously published under Q323490 On This PageSUMMARY
This article describes configuration information for .NET remoting when the remoting client is an ASP.NET application or the client is another remoted component hosted by Internet Information Services (IIS).
Configure Remoting Client in Global.asaxWhen you use a remote .NET component from an ASP.NET page, or from another IIS-hosted component, you must establish the remoting configuration on application startup. You cannot set a client configuration (that works) in the Web.config file in this scenario. Instead, use the Application_Start event in Global.asax for the application to peform any remoting configuration.IMPORTANT NOTE: The client configuration file can be any file, including Web.config. By default, client elements of Web.config are not read. To work around this behavior, in this example you must configure the client remoting configuration by using the Application_Start method. By default, service elements in Web.config are read, however. For clarity, this example uses a separate configuration file for the client. You may include your client configuration in the Web.config file, but you still must call Configure in Application_Start. Use Application_Start to Configure Remoting ClientThe following sample code is an example of the code that you add to the Application_Start method in the Global.asax to perform client remoting configuration:Remoting Client Configuration FileThe following sample code is an example of the configuration code that you can use in the configuration file. This sample code demonstrates how to use a well-known endpoint, the http channel, and the binary formatter.Remote Components Hosted by IISUse this method to set the remoting configuration when a remote component that is hosted by IIS is the client of another remote component. In this scenario, add a Global.asax file to the same virtual directory where the IIS-hosted remote component is located. Add configuration code to the Application_Start method as shown previously.REFERENCES
For more information visit the following Microsoft Web sites:
Hosting Remote Objects in Internet Information Services (IIS) (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ cpguide/html/cpconhostingremoteobjectsininternetinformationservicesiis.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhostingremoteobjectsininternetinformationservicesiis.asp) )
Remote Object Configuration (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ cpguide/html/cpconremoteobjectschannels.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconremoteobjectschannels.asp) )
Format for .NET Remoting Configuration Files For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ dndotnet/html/remotingconfig.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/remotingconfig.asp) ) 303247
(http://support.microsoft.com/kb/303247/EN-US/
)
INFO: ASP.NET Code-Behind Model Overview
| Article Translations
|
Back to the top
