ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories >> Software >> Microsoft-Related >> Dot-Net >> Dot-Net-Remoting
 
 


 

Back to Questions Page
 
Question
In which conditions do you opt for Remoting services?
Rank Answer Posted By  
 Question Submitted By :: Swapna
This Interview Question Asked @   Tech-Mahindra , Manland
I also faced this Question!!   © ALL Interview .com
Answer
If client and server belongs to same operation system then 
we have to go with remoting services..............
 
0
Krishna
 
 
Answer
when the word iteranet comes in pic we should prifer 2 use 
with condistion that saring with lot of pc
 
0
Sisir
 
 
Answer
if the two systems are in dotnet platform
 
0
Prasad
 
 
 
Answer
I don't know what Sisir is talking about... Remoting is 
something like web services. You might decide to opt for 
Remoting instead of web services in following cases...

1) Client and server platform is fixed
2) Protocol is NOT fixed. (Like web services strictly work 
on HTTP protocol)
3) Where object serialization is to be done strictly 
through CLR.
4) Where platform is fixed i.e. .Net framework.
 
0
Maruti Tathe
 
 
Answer
when both the server and client r under our control then we 
use .net remoting.
 
0
Veera
 
 
Answer
Remoting can be prefered 
1. Both server and Client sit in different machine.
2. Both server and client are .NET applications
3. The state of the objects transfered accross the network 
should be maintained.
4. The objects of the IDictionary interface should be 
transfered accross the network.
 
0
Vaidyanathan R
 
 
Answer
Remoting can be used for .net to .net communication in
distributed environment
 
0
Balavardhan Reddy
 
 
Answer
Remoting is used for .Net to .Net communication and in case 
of Remoting we can use protocol other than 
HTTP.Serialization in .Net remoting is handled by CLR 
in .net Remoting.
 
0
Amarjeet Singh
 
 
Question
What are the differences between Marshal by value and 
Marshal by reference?
Rank Answer Posted By  
 Question Submitted By :: Swapna
This Interview Question Asked @   Verizon
I also faced this Question!!   © ALL Interview .com
Answer
Marshal-by-value objects are copied by the remoting system 
and passed in their entirety to the caller's application 
domain. Once copied to the caller's application domain (by 
the marshaling process), all method calls and property 
accesses are executed entirely within that domain. The 
entire object exists in the caller's domain, so there is no 
need to marshal accesses across domain boundaries. Using 
marshal-by-value objects can increase performance and 
reduce network traffic when used for small objects or 
objects to which you will be making many accesses. However, 
because the object exists entirely in the caller's 
application domain, no state changes to the object are 
communicated to the originating application domain, or from 
the originator back to the caller. Marshal-by-value is not 
a good choice for very large objects with many accesses. It 
makes little sense to marshal an entire large object across 
domain boundaries when all you need is access to a single 
field, method, or property.
 
0
J's
 
 
Answer
Remoting makes an object in one process (the server) 
available to code in another process (the client). This is 
called marshalling, and there are two fundamentally 
different ways to marshal an object

-->Marshal by value: the server creates a copy of the 
object passes the copy to the client. 
-->Marshal by reference: the client creates a proxy for the 
object and then uses the proxy to access the object.
 
0
Rashmi Tiwari
 
 
Answer
MBV:the server creates a value and send it to the Client .
MBR:The Server sends the reference of that value to the Client.
 
0
Bolisettyvaas
 
 
Question
Give the Hierarchial description of remoting?
Rank Answer Posted By  
 Question Submitted By :: Swapna
This Interview Question Asked @   Satyam
I also faced this Question!!   © ALL Interview .com
Answer
.Net remoting is replacement of DCOM.
Step 1:Build a proxcy which is looks like a real obj.
Step 2:By useing proxcy U can make method calls on remoting 
       objs.
Step 3:These method calls know as "Messages", messages can 
be serialized by Formater.
Step 4:It send to client channel.
Step 5:Client channel communicate with sever channel. And 
Deserialized the Messages.
Step 6:Sever send the exact remot obj.
 
0
Madhu
 
 
Question
How to perform Remoting?
Rank Answer Posted By  
 Question Submitted By :: Swapna
I also faced this Question!!   © ALL Interview .com
Answer
Remoting Performance and Auto Web Proxy .

The .Net Framework 2.0 has significant changes to its 
support for proxies including support for connection-
specific proxy settings, automatic proxy configuration and 
the ability to automatically refreshing proxy settings 
whenever the active connection changes. These features can 
be very useful in .Net Remoting but the auto web proxy 
feature can also affect performance. If you do not need 
these settings in your client it might be useful to disable 
them.

There are a number of ways to disable this:

 

1.       In Internet Explorer Open Internet Options, 
(either through control panel or the Internet Explorer™ 
tools menu), switch to the connections tab, and select LAN 
settings. Clear all checkboxes under automatic 
configuration. This will disable automatic proxy settings 
for the current user (note that this will not work for 
ASP.NET sites making outgoing web service calls because 
they run under a different user).

2.       Imperatively disable it by setting 
System.Net.WebRequest.DefaultWebProxy = null;

3.       In your config file bypass the proxy for your web-
server. You can also disable the default proxy altogether.
 
0
Ramakrishna Pidugu
 
 
Question
When we use web service and when we use Remoting?
Rank Answer Posted By  
 Question Submitted By :: Swapna
I also faced this Question!!   © ALL Interview .com
Answer
.NET remoting is specifically used when you are using only 
Microsoft platform. Remoting cannot be used between .net 
client and non .NET clients.
Web services though can be used for communication on 
MIcrosoft technologies, but their main feature is Platform 
Interoperability.
So if you are using client and server supporting .NET 
framwork,  iwould recommend to use .NET remoting because 
you can customise it to great detail and also its faster.
If you are developing for cross platform technologies, you 
cannot use .NET remoting. So the only option you have is ot 
use web services
 
3
Ankit Dass
 
 
Answer
WebService is Platform,Object ,Programming Language
indepedent while remoting depends on platform means client
to be built using .NET Framework or other framework that
supports .NET Remoting
webservice can be accessed on http protocol and soap based
message formating while remoting supports tcp/http with
binary and soap based formating.
webservice is based on singlecall method means for every
request remote object is loaded, while remoting supports
singlecall and singleton method.
webservice lies under unbrella of Remoting.
 
0
Ganesh
 
 
Question
Choosing between HTTP and TCP for protocols and Binary and 
SOAP for formatters, what are the trade-offs? In what way 
it is best?
Rank Answer Posted By  
 Question Submitted By :: Swechcha
I also faced this Question!!   © ALL Interview .com
Answer
Binary over TCP is the most effiecient, SOAP over HTTP is 
the most interoperable.
 
0
Sathiya
 
 
Answer
Soap formatters are preffered over Binary as they do not 
firewall issue
 
0
Rajeshree
 
 
Question
How does assembly versioning in .NET prevent DLL Hell?
Rank Answer Posted By  
 Question Submitted By :: Swechcha
This Interview Question Asked @   Satyam
I also faced this Question!!   © ALL Interview .com
Answer
Using Zero impact deployment in .Net to prevent the DLL 
Hell Proplem.
 
0
Sathiya
 
 
Answer
here is the answer : : : 

 The runtime checks to see that only one version of an 
assembly is on the machine at any one time. 

.NET allows assemblies to specify the name AND the version 
of any assemblies they need to run. 

The compiler offers compile time checking for backward 
compatibility. 

It doesn.t.
 
0
Sivaraj.t
 
 
Answer
dll hell problem occurs due to more than one assembly being used for single application. How the applic ation will know which assembly to use? Assembly name and number that is version is specified so that the application can use specific assemblies.
 
0
Himanshu Raj
 
 
Question
How do you directly call a native function exported from a 
DLL?
Rank Answer Posted By  
 Question Submitted By :: Swechcha
I also faced this Question!!   © ALL Interview .com
Answer
Yes we can call a native function exported from a Dll in 
the following way,
I used C#.Net for Coding.

Add a Namespace that "System.Runtime.InteropServices"

Then use the following code,

Syntax:
[DllImport("dllname")]
here place the function in "dllname" Dll.
 
0
Moghan
 
 
Answer
HERE IS THE CODE EXAMPLE :

using System.Runtime.InteropServices; \
class C
{
	[DllImport("user32.dll")]
	public static extern int MessageBoxA(int h, string 
m, string c, int type);
	public static int Main()
	{
		return MessageBoxA(0, “Hello 
World!”, “Caption”, 0);
	}
}
 
0
Santhanakumar
 
 
Question
Can you configure a .NET Remoting object via XML file?
Rank Answer Posted By  
 Question Submitted By :: Swapna
I also faced this Question!!   © ALL Interview .com
Answer
Yes, via machine.config and application level .config file
(or web.config in ASP.NET). Application-level XML settings
take precedence over machine.config.
 
0
Venu
 
 
Question
What's the difference btw the following methods in .NET 
remoting?

RegisterWellknownServiceType()
RegisterWellknownClientType()
RegisterActivatedServiceType()
RegisterActivatedClientType()
Rank Answer Posted By  
 Question Submitted By :: Swapna
I also faced this Question!!   © ALL Interview .com
Answer
RegisterWellknownServiceType():
Method used to define and configure a remotable Object that 
needs to be Activated on server side. This takes 3 
parameter as follows:-
RegisterWellKnownServiceType( typeof( <Class/Object 
Name> ), <"SomeURI">, 
WellKnownObjectMode.Singleton/SingleCall );

RegisterWellknownClientType():
This method has to be used on the client module to 
comunicate with serve-side activated remote object. Ex:
RegisterWellKnownClientType( typeof( <Class/Object Name> ), 
<"Server Remotable Object URL"> );


RegisterActivatedServiceType():
RegisterActivatedClientType():
Similarly, the above two methods are used to define 
remotable object type as client activated.
 
0
Anil Kumar Mudajja
 
 
Question
About sn.exe ?
Rank Answer Posted By  
 Question Submitted By :: Deepa
This Interview Question Asked @   MMTS , Tcs
I also faced this Question!!   © ALL Interview .com
Answer
strong Name is the process of assinging the storng name to 
the shared assembly.
 
3
Ravinjaypee
 
 
Answer
sn.exe is a command line .Net tool that is used to create 
Strong Name. Different options are provided with this tool 
to Delete, Verify, generate etc public key pairs. That can 
be further used to register a .Net assembly.
 
2
Maruti Tathe
 
 
Question
About .NET Remoting and types of remoting ?
Rank Answer Posted By  
 Question Submitted By :: Deepa
This Interview Question Asked @   MMTS , Sun Guard
I also faced this Question!!   © ALL Interview .com
Answer
Remoting allows two processes, a Server and a Client, to 
communicate in the same system, the same network or across 
networks. It allows applications in the same or different 
domains to inter-communicate. This article discusses the 
concept of Remoting in .NET with a simple example using C#.

Local and Remote Objects

In Remoting, a local object is one that is confined to the 
same application domain in which it is created. The object 
is considered Remote if it resides in a different 
application domain and can be invoked remotely by abiding 
by some pre-defined protocols. A Remote object inherits 
from the class MarshalByRefObject.

Channels

Channels are used to establish communications between 
a .NET Server and a .NET Client. Channels are a means of 
message communication between a Server and a Client process 
in .NET Remoting. Each channel is associated with a 
specific port. The clients access the Remote objects using 
channels. Channels can be of the following types:

· Http Channel

· Tcp Channel

Formatters

Formatters are responsible for encoding and decoding 
messages that are transmitted between the server and the 
client's application domains using these Channels. There 
are two formatters:

· Binary Formatter

· SOAP Formatter

The respective formatter classes for the above formatters 
are:

System.Runtime.Serialization.Formatters.Binary.BinaryFormatt
er

System.Runtime.Serialization.Formatters.Soap.SoapFormatter

Remoting in action

In .NET Remoting we have three components, a Server class 
that extends the class MarshalByRefObject, a client class 
and a proxy. The client does not call a server’s method 
directly. Instead, it invokes the method on the proxy. The 
client channel object actually sends a message to the 
remote channel object. A formatter on the client’s 
application domain then encodes the message and passes the 
same through the transport channel onto the server’s 
application domain. The message is decoded by a formatter 
on the server’s application domain and then the appropriate 
server’s method is called on the object being invoked. 
After the method completes its execution, the results are 
returned back to the client.

Passing Objects in Remoting

In Remoting, objects are passed from the server to the 
client or vice-versa using a process known as Marshalling. 
Marshalling can be of the following two types:

· Marshal by reference

· Marshal by value

In Marshall by reference, a proxy of the server’s object is 
created in the client’s application domain. In Marshal by 
value however, the server creates a copy of the remote 
object and sends the same to the client. In order to 
implement Marshal by reference, the class should extend the 
class MarshalByRefObject. To implement Marshal by value 
however, you should implement the ISerializable interface 
or specify the keyword Serializable attribute when 
declaring the class. Marshal by value classes are also 
known as unbound classes and do not have a remote identity. 
The MarshalByRefObjects are also known as application 
domain-bound or context-bound objects.

Types of Remote Objects

The following are the types of Remote Objects:

· Client Activated

· Server Activated

A client-activated Remote Object is one which is 
instantiated by a client and whose lifetime is determined 
by a client. The object is alive as long as its services 
are required by the client. A server-activated Remote 
Object is one whose lifetime is determined by the remote 
object. Activation modes of the Server Activated Remote 
Objects can be of the following two types:

· Single Call Activation Mode

· Singleton Activation Mode

The Single Call Activation mode is stateless and can handle 
only one client request at any time. For each request a new 
object is created and after the request is serviced the 
object is marked as garbage and it is subject to garbage 
collection. The Singleton Activation mode is not stateless 
so it can serve multiple clients.
 
0
Mohan
 
 
Answer
NET Remoting is an enabler for application communication. 
It is a generic system for different applications to use to 
communicate with one another. .NET objects are exposed to 
remote processes, thus allowing interprocess communication
 
0
Praveen
 
 
Question
What are static assemblies and dynamic assemlies.
Differences between them ?
Rank Answer Posted By  
 Question Submitted By :: Wgk
This Interview Question Asked @   TCS
I also faced this Question!!   © ALL Interview .com
Answer
Static assemblies are stored on disk.But dynamic assemblies 
are directley loaded from memory.
 
0
Pravallika
 
 
Answer
Assemblies can be static or dynamic. Static assemblies can 
include .NET Framework types (interfaces and classes), as 
well as resources for the assembly (bitmaps, JPEG files, 
resource files, and so on). Static assemblies are stored on 
disk in PE files. You can also use the .NET Framework to 
create dynamic assemblies, which are run directly from 
memory and are not saved to disk before execution. You can 
save dynamic assemblies to disk after they have executed.
 
0
Jyoti Sharma
 
 
Question
What is a process ?
Rank Answer Posted By  
 Question Submitted By :: Wgk
This Interview Question Asked @   TCS
I also faced this Question!!   © ALL Interview .com
Answer
Process is set of task of an running application or an 
application itself, getting executed on a OS for which 
memory is allocated by OS.
 
0
Anil Kumar Mudajja
 
 
Answer
It’s an application that’s running and had been allocated 
memory
 
0
Bg
 
 
Answer
Processes are independent execution units that contain 
their own state information, use their own address spaces, 
and only interact with each other via interprocess 
communication mechanisms (generally managed by the 
operating system).
 
0
Tdotnet
 
 
Answer
process is a basic unit for which operating system allocates
processor time.
 
0
Saubhagya
 
 
Answer
A process is the execution of program.
 
0
Kumar
 
 
Answer
Process is a unit of execution.
 
0
Kavitharaveenthiran
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com