Open the code-behind file for the Global.asax
file.
To use the "System.Runtime.Remoting" namespace, add the
following code at the top of the Global.asax.cs file:
using System.Runtime.Remoting;
To use the Remoting.config file to register the objects to
be remoted, modify the Application_Start event as follows:
protected void Application_Start(Object sender, EventArgs e)
{
// Set the name of the remoting configuration file.
string remotingConfig = @"c:\inetpub\wwwroot\RemotingClientApp\Remoting.config";
// Register the remoted objects.
System.Runtime.Remoting.RemotingConfiguration.Configure(remotingConfig);
}
On the Debug menu, click
Start to run the application.
Click Button.
The current date
and the current time are displayed.
Use File Authorization to
Gain Access to the Remote Object
To use file authorization to gain access to the remote object,
add a file that has the Class1.rem Uniform Resource Identifier (URI) name to
the RemComponent folder. To do this, follow these steps:
Locate the C:\Inetpub\wwwroot\RemComponent
folder.
Use Notepad to create a file named
Class1.rem in the C:\Inetpub\wwwroot\RemComponent
folder.
Add the following line of code to the Class1.rem URI file,
and then save the file:
You may change the Access Control List (ACL) for the
Class1.rem file to use file authorization to gain access to the remote
object. To change the ACL for a file, follow these steps:
Start Windows Explorer.
Locate the Class1.rem file, and then click
Class1.rem.
On the File menu, click
Properties.
In the Properties dialog box, click
the Security tab.
Click to select the check boxes for the ACL
authorizations.
Server Error in '/RemotingClientApp' Application.
--------------------------------------------------------------------------------
BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version
1835627630.1699884645. 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.Serialization.SerializationException:
BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version
1835627630.1699884645.
For additional information,
click the following article number to view the article in the Microsoft
Knowledge Base:
323490
(http://support.microsoft.com/kb/323490/
)
INFO: Configure .NET Remoting When the Remoting Client Is an ASP.NET Application or the Client Is Another Remoted Component That Is Hosted by IIS