- Visual Basic and C Sharp Project templates
- Intellisense and code generators for XAML
- XAML design preview
- Debugging of Silverlight applications
- Remote debugging of Silverlight application for Mac
- Web reference support
- WCF Templates
- Team Build and command line build support
- Integration with Expression Blend
How to Uninstall Silverlight:
- Start menu -> Settings -> Click Control Panel
- Double Click Add or Remove Programs
- This will be opened “Add or Remove Programs Wizard”
- Find out installed Microsoft Silverlight. Then Click Remove Button
- After, you can see message “Are you sure you want to remove Microsoft Silverlight from your computer?”
- Click Yes Button
How to Install Silverlight:
- Download Silverlight.exe to Click to Install Button
- Double Click Silverlight.exe
- This will be opened “Open File – Security Warning” as Silverlight Run Wizard
- Click Run Button
- This will be opened “Install Silverlight Wizard”
- Click Install Now Button
- After, you can see message “Installation successful” for Silverlight
- Finally, Click Close Button
Explain the use of virtual, sealed, override, and abstract?
Abstract: The keyword can be applied for a class or method.
Class: If we use abstract keyword for a class it makes the class an abstract class, which means it cant be instantiated. Though it is not nessacary to make all the method within the abstract class to be virtual. ie, Abstract class can have concrete methods
Method: If we make a method as abstract, we dont need to provide implementation of the method in the class but the derived class need to implement/override this method.
Sealed: It can be applied on a class and methods. It stops the type from further derivation i.e no one can derive class from a sealed class,ie A sealed class cannot be inherited.A sealed class cannot be a abstract class.A compile time error is thrown if you try to specify sealed class as a base class. When an instance method declaration includes a sealed modifier, that method is said to be a sealed method. If an instance method declaration includes the sealed modifier, it must also include the override modifier. Use of the sealed modifier prevents a derived class from further overriding the method For Egs: sealed override public void Sample() { Console.WriteLine("Sealed Method"); }
Virtual & Override: Virtual & Override keyword provides runtime polymorphism. A base class can make some of its methods as virtual which allows the derived class a chance to override the base class implementation by using override keyword.
For e.g. class Shape
{
int a
public virtual void Display()
{
Console.WriteLine("Shape");
}
}
class Rectangle:Shape
{
public override void Display()
{
Console.WriteLine("Derived");
}
}
.NET Assembly Interview Question and Answer
01. How is the DLL Hell problem solved in .NET?
Ans : Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.
02. What are the ways to deploy an assembly?
Ans : An MSI installer, a CAB archive, and XCOPY command.
03. What is a satellite assembly?
Ans : When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.
04. What namespaces are necessary to create a localized application?
Ans : System.Globalization and System.Resources.
05. What is the smallest unit of execution in .NET?
Ans : an Assembly.
06. When should you call the garbage collector in .NET?
Ans : As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.
07. How do you convert a value-type to a reference-type?
Ans : Use Boxing.
08. What happens in memory when you Box and Unbox a value-type?
Ans : Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.
C # Class Interview Question and Answer
01. What is the syntax to inherit from a class in C#?
Ans : Place a colon and then the name of the base class.
Example: class MyNewClass : MyBaseClass
02. Can you prevent your class from being inherited by another class?
Ans : Yes. The keyword “sealed” will prevent the class from being inherited.
03. Can you allow a class to be inherited, but prevent the method from being over-ridden?
Ans : Yes. Just leave the class public and make the method sealed.
04. What’s an abstract class?
Ans : A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation.
05. When do you absolutely have to declare a class as abstract?
1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
2. When at least one of the methods in the class is abstract.
06. What is an interface class?
Ans : Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.
07. Why can’t you specify the accessibility modifier for methods inside the interface?
Ans : They all must be public, and are therefore public by default.
08. Can you inherit multiple interfaces?
Ans : Yes. .NET does support multiple interfaces.
09. What happens if you inherit multiple interfaces and they have conflicting method names?
Ans : It’s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay.
To Do: Investigate
10. What’s the difference between an interface and abstract class?
Ans : In an interface class, all methods are abstract - there is no implementation. In an abstract class some methods can be concrete. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.
11. What is the difference between a Struct and a Class?
Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is that structs cannot inherit.
C # Interview Question and Answer
01. Does C# support multiple-inheritance?
Ans : No.
02. Who is a protected class-level variable available to?
Ans : It is available to any sub-class (a class inheriting this class).
03. Are private class-level variables inherited?
Ans : Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.
04. Describe the accessibility modifier “protected internal”.
Ans : It is available to classes that are within the same assembly and derived from the specified base class.
05. What’s the top .NET class that everything is derived from?
Ans : System.Object.
06. What does the term immutable mean?
Ans : The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.
07. What’s the difference between System.String and System.Text.StringBuilder classes?
Ans : System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
08. What’s the advantage of using System.Text.StringBuilder over System.String?
Ans : StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.
09. Can you store multiple data types in System.Array?
Ans : No.
11. How can you sort the elements of the array in descending order?
Ans : By calling Sort() and then Reverse() methods.
12. What’s the .NET collection class that allows an element to be accessed using a unique key?
Ans : HashTable.
13. What class is underneath the SortedList class?
Ans : A sorted HashTable.
15. What’s the C# syntax to catch any possible exception?
Ans : A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.
16. Can multiple catch blocks be executed for a single try statement?
Ans : No. Once the proper catch block processed, control is transferred to the finally block (if there are any).
17. Explain the three services model commonly know as a three-tier application.
Ans : Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).
What are possible implementations of distributed applications in .NET?
.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.
When would you use .NET Remoting and when Web services?
Use remoting for more efficient exchange of information when you control both ends of the application. Use Web services for open-protocol-based information exchange when you are just a client or a server with the other end belonging to someone else.
What's a proxy of the server object in .NET Remoting?
It's a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.
What are remotable objects in .NET Remoting?
Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.
What are channels in .NET Remoting?
Channels represent the objects that transfer the other serialized objects from one application domain to another and from one
computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.
What security measures exist for .NET Remoting in System.Runtime.Remoting?
None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.
What is a formatter?
A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end. Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters
what are the trade-offs?
Binary over TCP is the most effiecient, SOAP over HTTP is the most interoperable.
What's SingleCall activation mode used for?
If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.
What's Singleton activation mode?
A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.
How do you define the lease of the object?
By implementing ILease interface when writing the class code.
Can you configure a .NET Remoting object via XML file?
Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.
How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
Use the Soapsuds tool.
What are CAO's i.e. Client Activated Objects ?
Client-activated objects are objects whose lifetimes are controlled by the calling application domain, just as they would be if the object were local to the client. With client activation, a round trip to the server occurs when the client tries to create an instance of the server object, and the client proxy is created using an object reference (ObjRef) obtained on return from the creation of the remote object on the server. Each time a client creates an instance of a client-activated type, that instance will service only that particular reference in that particular client until its lease expires and its memory is recycled. If a calling application domain creates two new instances of the remote type, each of the client references will invoke only the particular instance in the server application domain from which the reference was returned.In COM, clients hold an object in memory by holding a reference to it. When the last client releases its last reference, the object can delete itself. Client activation provides the same client control over the server object's lifetime, but without the complexity of maintaining references or the constant pinging to confirm the continued existence of the server or client. Instead, client-activated objects use lifetime leases to determine how long they should continue to exist. When a client creates a remote object, it can specify a default length of time that the object should exist. If the remote object reaches its default lifetime limit, it contacts the client to ask whether it should continue to exist, and if so, for how much longer. If the client is not currently available, a default time is also specified for how long the server object should wait while trying to contact the client before marking itself for garbage collection. The client might even request an indefinite default lifetime, effectively preventing the remote object from ever being recycled until the server application domain is torn down. The difference between this and a server-activated indefinite lifetime is that an indefinite server-activated object will serve all client requests for that type, whereas the client-activated instances serve only the client and the reference that was responsible for their creation. For more information, see Lifetime Leases.To create an instance of a client-activated type, clients either configure their application programmatically (or using a configuration file) and call new (New in Visual Basic), or they pass the remote object's configuration in a call to Activator.CreateInstance. The following code example shows such a call, assuming a TcpChannel has been registered to listen on port 8080.
How many processes can listen on a single TCP/IP port?
One.
What technology enables out-of-proc communication in .NET?
Most usually Remoting;.NET remoting enables client applications to use objects in other processes on the same computer or on any other computer available on its network.While you could implement an out-of-proc component in any number of other ways, someone using the term almost always means Remoting.
How can objects in two diff. App Doimains communicate with each other?
.Net framework provides various ways to communicate with objects in different app domains.First is XML Web Service on internet, its good method because it is built using HTTP protocol and SOAP formatting. If the performance is the main concern then go for second option which is .Net remoting because it gives you the option of using binary encoding and the default TcpChannel, which offers the best interprocess communication performance
Categories
Popular Posts
-
.NET Remoting Interview Questions and Answers What distributed process frameworks outside .NET do you know? Distributed Computing Environme...
-
Today, It is many tools available on the market for creating application for mobile phones and portable devices. The Microsoft introduced m...
-
The Unified Modeling Language is only a language. It is not a way of designing a system, but it is a way to model a system. The main object ...
-
Step 1: Visual Studio 2008 Service Pack 1 supporting tool for Microsoft Silverlight 2 It can be installed software for developers like Vis...
-
.NET Assembly Interview Question and Answer 01. How is the DLL Hell problem solved in .NET? Ans : Assembly versioning allows the application...
-
Essential documentation in projects In the previous article we discussed the various SDLC life cycle models. For every stage in the model...
-
Introducing ASP.NET Create dynamic web pages by using server side scripting like ASP (Active Server Page). It has introduced by Microsof...
-
MCSD - Microsoft Certified Solution Developer This certification for two plus years of experience software developing and maintaining i...
-
Windows Communication Foundation is one of main new technologies that are included in .NET 3.0. Windows Communication Foundation (WCF), form...
-
The Growth of software professional If you are self taught programmer or working in a company which is not process oriented the title of ...