.NET Remoting to Gen 8.6 C# server fails with "(404) Not Found"
search cancel

.NET Remoting to Gen 8.6 C# server fails with "(404) Not Found"

book

Article ID: 7375

calendar_today

Updated On:

Products

Gen Gen - Run Time Distributed

Issue/Introduction

Trying to call Gen 8.6 .NET C# server via .NET Remoting fails with:

GenException: [Function: NETDynamicCoopFlow::ProcessException]The remote server returned an error: (404) Not Found.

Tests done with Gen sample model using an ASP.NET Client and also a C client (Gen C to C# Cooperative Flow).
The same error occurs for both tests.

Environment

Gen 8.6
IIS 10.x
NET v4.x

Cause

Enable ASP.NET client coopflow trace using cmidebug=-1 in the web.config file and the resulting trace*.out file shows:

05/11/26-12:06:57:218244[11]: NETDynamicCoopFlow::DoFlow(): Loaded Server Method: sample.ServerMaintainDivisionExport Execute(sample.ServerMaintainDivisionImport, System.Object, System.Object)
05/11/26-12:06:57:218244[11]: NETDynamicCoopFlow::DoFlow(): Remote Server Address: http://localhost:80/sample/ServerMaintainDivision.rem
05/11/26-12:06:57:280718[11]: GenException::TraceDump(): GenException created: 
05/11/26-12:06:57:280718[11]: GenException: [Function: NETDynamicCoopFlow::ProcessException]The remote server returned an error: (404) Not Found.

The problem is caused by IIS deployment missing the handler mapping for *.rem files or that handler is not configured correctly.

Resolution

Options to install the *.rem file handler

  1. Create *.rem file handler mapping via Web Server (IIS) install options:
    When doing an IIS install selecting option ASP.NET 4.8 under "Web Server (IIS) > Web Server > Application Development" will also install the *.rem handler HttpRemotingHandlerFactory-rem-Integrated-4.0. This is the recommended option.

  2. Manually create a *.rem handler mapping:
    Per Microsoft > Learn > IIS >Handlers <handlers> add a Managed Handler for *.rem files using these values:
    1. Request path: *.rem 
    2. Type: System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 
    3. Name: HttpRemotingHandlerFactory-rem-Integrated-4.0
    4. Request Restrictions:
      1. Mapping: IMPORTANT: The default for "Invoke handler only if request is mapped to:" is checked and set to File. That option MUST BE UNCHECKED #1
      2. Verbs tab: Select checkbox "one of the following verbs" and add these values GET,HEAD,POST,DEBUG 
      3. Access tab: Select "Script"

        #1 When the handler is created via the IIS install "Request Restrictions > Mapping" option "Invoke handler only if request is mapped to:" is unchecked. If it is checked and set to File then the  404 error will continue.
        In the context of .NET Remoting, a *.rem file is not a physical file on disk. It is a "virtual" file extension used as a signal to Internet Information Services (IIS) to route a request to the .NET Remoting infrastructure. That is why the handler fails when the File option is used.