Está en la página 1de 5

What is Difference between NameSpace and Assembly?

Following are the differences between namespace and assembly : Assembly is physical grouping of logical units. Namespace logically groupsclasses. Namespace can span multiple assembly If you want to view a Assembly how to you go about it ? Twist : What is ILDASM ? When it comes to understanding of internals nothing can beat ILDASM.ILDASM basically convertsthe whole exe or dll in to IL code.To run ILDASM you have to go to "C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin". Note that i had v1.1 you have to probably change itdepending on the type of framework version you have.If you run IDASM.EXE from the path you will be popped with the IDASM exe program asshown in figure ILDASM.Click on file and browse to the respective directory for the DLL whoseassembly you want to view.After you select the DLL you will be popped with a tree view detailsof the DLL as shown in figure ILDASM.On double clicking on manifest you will be able to viewdetails of assembly , internal IL code etc as shown in Figure Manifest View. Where is version information stored of a assembly ? Version information is stored in assembly in manifest. Is versioning applicable to private assemblies? Versioning concept is only applicable to global assembly cache (GAC) as private assembly lie inthere individual folders. What is GAC ? Twist :- What are situations when you register .NET assembly in GAC ? GAC (Global Assembly Cache) is used where shared .NET assembly reside.GAC is used in the following situations :If the application has to be shared among several application. If the assembly has some special security requirements like only administrators can remove the assembly. If the assembly is private then a simple delete of assembly the assembly file will remove the assembly. Note: - Registering .NET assembly in GAC can lead to the old problem of DLL hell. Where COM version was stored in central registry. So GAC should be used when absolutely necessary. What is concept of strong names ? Twist :- How do we generate strong names or what is the process of generating strong names , What is use of SN.EXE , How do we apply strong names to assembly ? , How do you sign an assembly? Strong name is similar to GUID (It is supposed to be unique in space and time) in COM components. Strong Name is only needed when we need to deploy assembly in GAC. StrongNames helps GAC to differentiate between two versions. Strong names use public key cryptography (PKC) to ensure that no one can spoof it. PKC use public key and private key concept. Following are the step to generate a strong name and sign a assembly: (B) What is Delay signing? During development process you will need strong name keys to be exposed to developer which will is not a good practice from security aspect point of view. In such situations you can assign the key later on and during development you an use delay signing. Following is process to delay sign a assembly:

First obtain your string name keys using SN.EXE. Annotate the source code for the assembly with two custom attributes from System.Reflection: AssemblyKeyFileAttribute, which passes the name of the file containing the public key as a parameter to its constructor. AssemblyDelaySignAttribute, which indicates that delay signing is being used by passing true as a parameter to its constructor. For example as shown below: [VisualBasic]<Assembly:AssemblyKeyFileAttribute("myKey.snk")><Assembly:Asse mblyDelaySignAttribute(true)>[C#] [assembly:AssemblyKeyFileAttribute("myKey.snk")] [assembly:AssemblyDelaySignAttribute(true)] What is reflection? All .NET assemblies have metadata information stored about the types defined in modules. This metadata information can be accessed by mechanism called as Reflection.System.Reflection can be used to browse through the metadata information. Using reflection you can also dynamically invoke methods using System.Type.Invokemember .Below is sample source code if needed you can also get this code from CD provided, go to Sourcecode folder in Reflection Sample folder. What are different type of JIT ? JIT compiler is a part of the runtime execution environment In Microsoft .NET there are three types of JIT compilers: Pre-JIT. Pre-JIT compiles complete source code into native code in a single compilation cycle. This is done at the time of deployment of the application. Econo-JIT. Econo-JIT compiles only those methods that are called at runtime. However, these compiled methods are removed when they are not required. Normal-JIT. Normal-JIT compiles only those methods that are called at runtime. These methods are compiled the first time they are called, and then they are stored in cache. When the same methods are called again, the compiled code from cache is used for execution. Whats difference between System exceptions and Application exceptions? All exception derives from Exception Base class. Exceptions can be generated programmatically or can be generated by system. Application Exception serves as the base class for all application specific exception classes. It derives from Exception but does not provide any extended functionality. You should derive your custom application exceptions from Application Exception. Application exception are used when we want to define user defined exception. While system exception are all which are defined by .NET Do webservice have state? Webservices as such do not have any mechanism by which they can maintainstate. Webservices can access ASP.NET intrinsic objects like Session , application etc. if they inherit from WebService base class. <%@ Webservice class="TestWebServiceClass" %>Imports System.Web.ServicesPublic class TestWebServiceClass Inherits WebService<WebMet hod> Public Sub SetSession(value As String)session("Val") = ValueEnd Subend class. Above is a sample code which sets as session object calles as val. TestWebserviceClassis inheriting from WebService to access the session and application objects In which event are the controls fully loaded ?

Page_load event guarantees that all controls are fully loaded. Controls are also accessed inPage_Init events but you will see that viewstate is not fully loaded during this event What is event bubbling ? Server controls like Datagrid , DataList , Repeater can have other child controls inside them. Example DataGrid can have combo box inside datagrid. These child control do notraise there events by themselves , rather they pass the event to the container parent(which can be a datagrid , datalist , repeater) , which passed to the page as ItemCommandevent. As the child control send there events to parent this is termed as event bubbling. Administrator wants to make a security check that no one has tampered with ViewState , how can he ensure this ? Using the @Page directive EnableViewStateMac to True. Whats the use of @ Register directives ? @Register directive informs the compiler of any custom server control added to thepage Whats the use of SmartNavigation property ? Its a feature provided by ASP.NET to prevent flickering and redrawing when the page isposted back. How can we force all the validation control to run ? Page.Validate How can we check if all the validation control are validand proper ? Using the Page.IsValid() property you can check whether all the validation are done How to disable client side script in validators? Set EnableClientScript to false If want to show the entire validation error message in amessage box on the client side? In validation summary set ShowMessageBox to true How can we kill a user session ? Session.abandon How do I send email message from ASP.NET ? ASP.NET provides two namespaces System.WEB.mailmessage classandSystem.Web. Mail.Smtpmail class. Just a small homework create a Asp.NET project andsend a email at shiv_koirala@yahoo.com . Do not Spam How do I sign out in forms authentication ? FormsAuthentication.Signout() What is three tier architecture? The three tier software architecture emerged in the 1990s to overcome the limitations of the two tier architecture.There are three layers in when we talk about three tier architecture:User Interface (Client) :- This is mostly the windows user interface or the Web interface.But this has only the UI part.

Mid layer: - Middle tier provides process management where business logic and rules are executed and can accommodate hundreds of users (as compared to only 100 users with the two tier architecture) by providing functions such as queuing, application execution, and database staging. Data Access Layer: - This is also called by the famous acronym "DAL" component. It has mainly the SQL statement which do the database operation part of the job What is Service Oriented architecture? Services are components which expose well defined interfaces and these interfacescommunicate through XML messages. Using SOA you can build workflow, which uses interfaces of these components. SOA is typically useful when you are crossingheterogeneous technical boundaries, organizations, domain etc.In .NET SOA technically uses Web services to communicate with each service which iscrossing boundaries. You can look SOA which sits on TOP of web services and provides a workflow.SOA uses service components which operate in there own domain boundary. Lets notesome points of service :They are independent components and operate in there own boundary andown technology. They have well defined interfaces which use XML and WSDL to describethemselves. Services have URL where any one can find them and clients can bind to theseURL to avail for the service. Services have very loosely coupled architecture. In order to communicate toservice you only have to know the WSDL. Your client can then generate proxy from the WSDL of the service. What are different ways you can pass data between tiers? There are many ways you can pass data between tiers :Dataset the most preferred one as they maintain data in XML format. Datareader Custom classes. XML How can we add/remove rows in DataTable object ofDataSet Datatable provides NewRow method to add new row to DataTable.DataTablehas DataRowCollection object which has all rows in a DataTable object.Followingare the methods provided by DataRowCollection object Add Adds a new row in DataTable Remove Removes a DataRow object from DataTable RemoveAt Removes a DataRow object from DataTabledepending on index position of theDataTable Whats difference between Optimistic andPessimistic locking ? In pessimistic locking when user wants to update data it locks the record and till then noone can update data.Other users can only view the data when there is pessimistic locking.In optimistic locking multiple users can open the same record for updating , thus increasemaximum concurrency.Record is only locked when updating the record.This is the most preferred way of locking practically.Now a days browser based application are very common and having pessimistic locking is not a practical solution

What is RAID and how does it work ? Redundant Array of Independent Disks (RAID) is a term used to describe the technique of improving data availability through the use of arrays of disks and various datastriping methodologies. Disk arrays are groups of disk drives that work together to achieve higher data-transfer and I/O rates than those provided by single large drives. An array is a set of multiple disk drives plus a specialized controller (an array controller) that keeps track of how data is distributed across the drives. Data for a particular file is written in segments to the different drives in the array rather than being written to a single drive. What is SQl injection ? It is a Form of attack on a database-driven Web site in which the attacker executes unauthorized SQL commands by taking advantage of insecure code on a system connected to the Internet, bypassing the firewall. SQL injection attacks are used to steal information from a database from which the data would normally not be available and/or to gain access to an organizations host computers through the computer that is hosting the database.SQL injection attacks typically are easy to avoid by ensuring that a system has strong input validation.As name suggest we inject SQL which can be relatively dangerous for the database.Example this is a simple SQLSELECT email, passwd, login_id, full_name FROM membersWHERE email = 'x

También podría gustarte