Link to home
Start Free TrialLog in
Avatar of jaxrpc
jaxrpc

asked on

.Net remoting with asp.nent client

Dear Experts, i have a .NET remoting server app which runs on a comm server and i have a remoting client winapp which i can control mp3 playback on multiple soundcards. Now i would like to do the same thing on web based. using back the same codes as in my remoting client winapp. i got errors like -

System.Runtime.Remoting.RemotingException was unhandled by user code
  Message="Attempt to redirect activation of type 'IAudio, App_Code.amdtefbr' which is already redirected."
  Source="mscorlib"

How do i go about to call methods remotely from asp.net client? thanks for reading.

 
Avatar of Nandakumar Sakthivel
Nandakumar Sakthivel
Flag of United States of America image

Hi,
    In the Application_Start event of global.asax file specify the remote configuration file that you are using for configuring remoting(It will hold the remoting server name and type of channels and formatting used)

          RemotingConfiguration.Configure(HttpContext.Current.Server.MapPath(<file name with path>))  (Include this in application_onstart)

Consider the name of the file as remoting.exe.config
The file should have the following syntax

<configuration>
  <system.runtime.remoting>
    <application>            
         <client url="http://<server name>/<remoting virtual directory>">
              <activated type=<class name>,<assembly name>" />  
            </client>
         <channels>
                   <channel ref="http" useDefaultCredentials="true">            
            <clientProviders>                  
            <formatter ref="binary" />
            </clientProviders>
           <serverProviders>                  
               <formatter ref="binary" typeFilterLevel="Full" />
           </serverProviders>                  
           </channel>
   </channels>
    </application>
  </system.runtime.remoting>
  <system.web>
      <customErrors mode="On" />
</system.web>
</configuration>

In the above config example it had used binary formatting with http channel(You can change this as per your requirement).
where class name is the name of the class that you are activating in the assembly.

In the remoting server machine create a virtual directory and put your dlls in the physical folder and place a web.config file to say the type of formatting and channels that you are using

example of that is

<system.runtime.remoting>
            <application>
                  <channels>
                        <channel ref="http">
                              <serverProviders>                  
                                    <formatter ref="binary" typeFilterLevel="Full" />
                                          </serverProviders>
                        </channel>
                  </channels>
                       <service>
                            <activated type=<class name>,<assembly name>" />  
                       </service>
            </application>
</system.runtime.remoting>
 
There are two types of activation of remoting object(client and server). you can use as per your requirements

Thanks,
Nanda
Avatar of jaxrpc
jaxrpc

ASKER

thanks for the info i will try them. just a question. can i use the tcp protocol for asp.net?
Avatar of jaxrpc

ASKER

sorry left out 1 thing.

You said :
In the remoting server machine create a virtual directory and put your dlls in the physical folder and place a web.config file to say the type of formatting and channels that you are using

If my remoting server app is a windows app, are the above steps still necessary? what's the rational for doing it?

thks
Hi,
    I had explained the remoting configuration only for a web application.Can you explain me your senarion little bit more .You said that your  remoting server app is a windows app(Is it an exe file or class library).Whether Your client is also a windows client or browser?.I haven't worked with remoting in windows app

Thanks,
Nanda
   
   
Avatar of jaxrpc

ASKER

hi, my remoting server is an exe and the client to talk to it will be an asp.net client.
Hi,

    https://www.experts-exchange.com/questions/21898800/Vb-net-remoting-with-interface.html

The above link has an example of using remoting as windows app.

Thanks,
Nanda



ASKER CERTIFIED SOLUTION
Avatar of Nandakumar Sakthivel
Nandakumar Sakthivel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial