Creating and Managing Microsoft Windows(r) Services, Serviced Components, .NET Remoting Objects, and XML Web Services

  • The SessionID property of the HttpSessionState class identifies an active ASP.NET session by using a unique session ID.
  • The Process.Start method is used to start a Windows application and is registered in the system registry on a computer.
  • The Status property of the ServiceController class specifies the status of the current instance of a Windows service.
  • If a class derives from the ServiceBase class, the OnCustomCommand method is executed when the Service Control Manager (SCM) passes a custom command to the service. This method is used to specify actions when a command with the specified parameter value occurs.
  • The AutoLog property of the ServiceBase class is used to determine whether or not a service automatically logs the entries in the event log when events such as Start, Stop, Pause, and Continue occur.
  • The CreateEventSource method of the EventLog class establishes an application as a valid event source for writing event information to a particular event log on a computer.
  • The Imports statement is used to import namespace names from referenced projects and assemblies.
  • The Installutil tool is used to install a Windows application. The .NET class library provides some predefined installer classes that helps in application installation.
  • As soon as a computer’s power status changes, the Service Control Manager or SCM of a Windows service verifies whether the service accepts power event commands. When the CanHandlePowerEvent property is set to true, the power event command is passed to the service and then the OnPowerEvent method is called.
  • The Assembly Registration (Regasm.exe) tool is used to read metadata within an assembly. It also adds the necessary entries to the registry allowing a COM client to create .NET Framework classes. Once a class is registered using Regasm.exe, a COM client can use it as a COM component.
  • A publisher policy configuration file contains compatibility information issued by the publisher of a shared component.
  • The ClassInterface attribute is used to indicate the type of class interface to be generated for a class.
  • The ClassInterfaceType enumeration identifies the type of class interface generated for a class.
  • The AutoDual value of the ClassInterfaceType enumeration specifies that a dual class interface is automatically generated for a class.
  • The IsCallerInRole method of the ContextUtil class determines whether the client is having the specific role or not.
  • In a method, the value of the parameters that are passed as ByVal, cannot be changed by a procedure or function. On the other hand, the value of the parameters that are passed as ByRef, can be changed by a procedure or function.
  • The .NET Framework allows sharing of an assembly among multiple applications. Such an assembly is called shared assembly. All assemblies stored in global assembly cache must have strong names.
  • The Strong Name (Sn.exe) tool is used to sign assemblies with strong names. It also provides signature generation, signature verification, and key management.
  • A strong name consists of an assembly’s identity, public key, and digital signature.
  • The AutoComplete attribute enables an object that is participating in a transaction to vote in favor of completing the transaction if the method calls returns normally.
  • A serviced component is a .NET component that uses component services of COM, such as object pooling, transaction management, etc.
  • The serviced component in a COM application is hosted by assigning a strong name to the assembly, registering the assembly in the Windows registry, and registering and installing the type library definitions in a COM application.
  • A component is first signed with a strong name and then is installed in the global assembly cache.
  • While processing a transaction, the Aborted state occurs when the transaction fails due to unsuccessful execution of a task.
  • During the Manual registration, the assembly fails to load error type occurs due to which the error message that describes the reason for the failure is displayed as output.
  • The AutoComplete attribute of the System.EnterpriseServices namespace applies to the methods of the serviced component class.
  • The StrongNameIdentityPermissionAttribute class is used to allow security actions to be applied to code using declarative security.
  • The PublicKey property of the StrongNameIdentityPermissionAttribute class specifies the public key value of the strong name identity and is expressed as a hexadecimal string.
  • The Sn.exe tool is used to sign a portable executable file for a component or an assembly with an Authenticode digital signature.
  • The following are the advantages of early binding:
    1. Objects are created faster.
    2. Information about properties and methods of the object is available in design environment.
  • The @ Register directive is used to associate aliases with namespaces and classes.
  • The BeginReceive method of the MessageQueue class initiates an asynchronous operation and a MessageQueue object begins receiving a message and notifies the ReceiveCompleted event handler when the operation is finished.
  • The EndReceive method of the MessageQueue class is called when the ReceiveCompleted event is raised. The method completes the specified asynchronous operation received by the MessageQueue object.
  • The HttpChannel class is used to provide an implementation for a sender-receiver channel that uses the HTTP protocol for transmitting messages.
  • The SoapFormatter class is used to serialize and deserialize an object in SOAP format.
  • The EnableSession property of the WebMethodAttribute class is used to enable session state for an XML Web service method.
  • Server-activated objects (SAOs) are remote objects whose lifetime is controlled by the server. These objects can be activated as SingleCall or Singleton objects.
  • A SingleCall object is created for each client request.
  • A Singleton object is created once on the server and shared by all clients.
  • The SerializableAttribute attribute specifies whether or not a class can be serialized.
  • Client-activated objects (CAOs) are objects that are created whenever a client requests for a remote object to be created.
  • The System.Runtime.Remoting namespace is used to provide classes and interfaces that create and configure distributed applications.
  • The System.Runtime.Remoting.Channels.Tcp namespace consists of channels that use the TCP protocol for transmission of messages and objects to and from remote locations.
  • The <wellknown> element is used to specify that a remoting object is a server-activated object.
  • Use the <channel> element to specify that a application configures the channel through which it communicates with remote objects. A new channel that is not a channel template can also be declared and configured.
  • In a SingleCall object, a new object is created whenever a message arrives. The new object then processes the message and returns an optional reply. Finally, the object created is discarded.
  • SOAP is an XML-based protocol and defines rules for data encoding.
  • s

  • The SoapUnknownHeader class is used to handle data received from a SOAP header but not understood by any recipient Web service.
  • While defining and processing SOAP headers, a class representing data in a particular SOAP header needs to be defined. The class must be derived from the SoapHeader class.
  • The <types> section of the WSDL file defines data types and data structures used by a Web service.
  • The Session object is used to create a variable that will be available as long as the session is active.
  • Web Services Description Language (Wsdl.exe) is a tool used to generate code for XML Web services and Web service clients from WSDL, XSD schema files, and discovery documents.
  • When a Web response is not formatted correctly for a Web request, a CLR SOAPException exception that occurs in the XML Web service method, is thrown.
  • The Peek method of the StreamReader class returns an integer type value to determine whether or not the end of the file or an error has occurred. It returns value -1 if no characters are available on the stream or the end of file has reached.
  • XML Web service is a programmable entity providing a particular element of functionality, such as application logic.
  • HTTP-GET, HTTP-POST, and HTTP-SOAP protocols are used to test a Web application from a Web browser by using ASP.NET.
  • The HTTP-GET and HTTP-POST protocols are the standard Web protocols that send parameters as name-value pairs to an XML Web service.
  • SOAP (Simple Object Access Protocol), UDDI (Universal Description, Discovery, and Integration), and WSDL (Web Services Description Language) protocols are used to discover Web Services and interfaces on the Internet for a WebService.
  • XML Web services can be used internally or externally over the Internet by Web applications by employing Internet standard protocols that include XML, SOAP, XSD, and WSDL.
  • The MemberName property of the SoapHeaderAttribute class specifies the member of the XML Web service that represents the SOAP header contents.
  • The MessageName property of the WebMethod attribute is used to give an alias name to an XML Web service method. It is generally used to uniquely identify overloaded Web methods.
  • A XML Web service is used to open wire formats to communicate between different systems. Open wire formats are the protocols that support common Web standards, such as HTTP and SOAP.
  • An XML Web service is a programmable entity providing a particular element of functionality, such as application logic.
  • The WebMethod attribute declares a method within an XML Web service. It makes the method callable from remote Web clients.
  • The Description property of the WebMethod attribute is used to specify a descriptive message for an XML Web service method. It accepts a string as an input value.
  • The DiscoveryDocumentReference class is used to discover the available XML Web services as given by a URL. The URL must point to the discovery document that has the .disco file extension.
  • The TcpChannel, TcpClientChannel, and TcpServerChannel classes are used to authenticate as well as to encrypt data for secure data communication.
  • The RateOfCountsPerSecond32 value for PerformanceCounterType is used to display the average number of operations completed every second.

Consuming and Manipulating Data

  • An attribute name must begin with a letter or an underscore. A string value assigned to an attribute is delimited using either single quotes or double quotes.
  • When an array in Visual Basic .NET is declared, only the upper bound of the array is defined.
  • The first row of a table can be deleted either by using the Delete method of the DataRow object or by invoking the Remove method of the Rows collection. After deleting the row, the Update method of the DataAdapter class is used to apply the changes been made to the database.
  • The Cache object implements the cache for a Web application. The Session object pertains to an individual user’s session with an application. It is used to store and retrieve information during a specific session for a user.
  • A DataRelation object relates two DataTable objects to each other through DataColumn objects. It can be accessed through the Relations property of the DataSet object.
  • When data tables are fetched from the databases they must be stored in the DataSet. Datagrid is used to show the data tables on the application form.
  • The AcceptChanges method of the DataTable class commits all changes made to a table since it was last called. This method should be used after the updates have been made to the data set.
  • The OleDbConnection class represents an open connection to an OLE DB data source, a Microsoft SQL Server 6.x database, or earlier version. The OleDbCommand object represents a stored procedure or a SQL statement to execute at a data source.
  • The MinPoolSize value of the ConnectionString property of the SqlConnection class is used to specify the minimum number of connections allowed in a pool.
  • The SqlCommand class represents a stored procedure or a SQL statement to execute at a SQL Server database.
  • The CommandType property of the SqlCommand class specifies how the command string is interpreted.
  • A connection string is modified to use the same login ID and password for all connections to a database. This will enable the application to use a single connection pool.
  • The NextResult method of the SqlDataReader class is used to process multiple results that are generated by executing a stored procedure.
  • The Fill method of the DbDataAdapter class is used to add rows in a DataSet to match those in a data source.
  • The Add method of the DataRelationCollection class adds a DataRelation object to the collection of DataRelation objects in a DataSet.
  • The ContinueUpdateOnError property of the SqlDataAdapter class gets or sets a value that specifies whether to generate an exception, or the row in error when an error is encountered during a row update.
  • The Precision property of the SqlParameter class is used to get or set the maximum number of digits that are used to represent the Value property.
  • The ExecuteNonQuery method of the SqlCommand class is used to execute commands that change a database. These commands include the Transact-SQL INSERT, UPDATE, DELETE, and SET statements.
  • The OleDbDataAdapter class is used to represent a database connection and a set of data commands that are used to fill the DataSet and update the data source. It is used as a bridge between a DataSet and data source to save and retrieve data.
  • The LoadDataRow method of the DataTable class finds the matching value and updates a specific row in the primary column of a specific table. If the value does not match, a new row is created.
  • The SqlConnection class represents an open connection to a Microsoft SQL Server. It is used to represent a unique session to a Microsoft SQL Server 7.x database or later.
  • The OleDbConnection class represents an open connection to a data source. It is used to represent a unique session to an OLE DB data source, or to a Microsoft SQL Server 6.x database or earlier.
  • The AllowDBNull property is used to set restrictions on the column of a table. It is used to restrict the null values in a particular column, if its value is set to false.
  • The ExecuteScalar method of the SqlCommand class is used to execute a query against a data source. It returns the first column of the first row in the resultset returned by the query. It is commonly used to execute aggregate functions such as COUNT, SUM, etc., on a table.
  • The Direction property of the SqlParameter class is used to get or set a value, which indicates the type of a parameter. A parameter can be input-only, output-only, bi-directional, or a stored procedure return value parameter.
  • The RowStateFilter property displays only the modified records in a DataView object.
  • A stored procedure is a group of Transact-SQL statements compiled into a single execution plan. It can be used to implement business logic or as a security mechanism, but it is not executed automatically.
  • The OuterXml property of the XmlNode class is used to retrieve the markup representing an XML node and its children nodes.
  • The DataReader class is used to retrieve a read-only and forward-only stream of data. It optimizes the performance of an application because only one row at a time remains in the memory.
  • The ReadXml method of the DataSet class reads from an XML file, a stream or an XmlReader.
  • The RowFilter property of the DataView class is used to get or set the expression to filter the rows to be viewed in a DataView object.
  • The WriteXmlSchema method of the DataSet class is used to write the DataSet structure as an XML schema to an XML file.
  • SQL Server 2000 supports the FOR XML clause with the SELECT statement. The FOR XML clause instructs the SELECT statement to return the query result in an XML format instead of a tabular format.
  • An ADO.NET DataSet is a memory-resident representation of data. It is a collection of tables and information about the relationships that exist between tables.
  • The Add method of the DataRelationCollection class adds a DataRelation object to the collection of DataRelation objects in a DataSet.
  • The Clone method of the DataSet class copies only the schema of a DataSet object. However, it does not copy any data from the existing DataSet object into the new DataSet.
  • The Contains method of the DataRelationCollection class is used to determine whether or not the primary key column or columns of any row in a DataRowCollection object contains the specified value. It returns a Boolean value.
  • The Find method of the DataRelationCollection class is used to get a specified row from a collection of DataRow objects.
  • The ExecuteNonQuery method of the SqlCommand class returns an integer value, which indicates the number of rows affected as a result of the execution of a SQL statement.
  • The GetChanges method of the DataSet class is used to retrieve the records after accepting changes made to a table in a database. The method gets a copy of all the changes made before the AcceptChanges method was called or since it was last loaded.
  • The SqlConnection class represents an open connection to a SQL Server database. ADO.NET supports connection pooling where the SqlConnection class is used to increase the performance of the application.
  • The SqlConnection.BeginTransaction method starts a database transaction.
  • The SqlTransaction.Connection property returns a SqlConnection object in association with a transaction that can take place for each new database connection.
  • The Merge method of the DataSet class is used to incorporate the latest changes from a data source into an existing DataSet object.
  • The GetXml method of the DataSet class returns the XML representation of data from a DataSet.
  • The XmlDocument class represents the top node of an XML document.
  • The XmlReader class defines properties that are used to retrieve information about the name and content of the current node.
  • The System.Threading namespace provides interfaces and classes that enable multithreaded programming in XML.
  • An XML document must have only one top-level element known as document element or root element. Each element must have both a start tag and an end tag.
  • An XML document consists of two main parts, namely prolog and document.
  • The GetChanges method of the DataSet class returns a copy of the DataSet. It contains all changes made to the DataSet since it was last loaded or since the AcceptChanges method was called.
  • The AutoIncrementStep property of the DataColumn class is used to set the value of the step by which the column value is to be incremented.
  • The text argument of the MessageBox() function can be used to display a message on the message box.
  • The DeleteRule property of the ForeignKeyConstraint class is used to specify the action that is to occur when a row is deleted.
  • The EnableViewState property of a DataGrid control specifies whether or not the server control maintains its own view state and the view states of its child controls. Setting this property to False will improve the performance of the application, as it will disable the view states.
  • The GetInt32 method of the OleDbDataReader class receives the value from a specified column as a 32-bit int data type.
  • To normalize data and apply indexes on the tables in a database is to improve the application’s performance.
  • The XPathDocument class is used to provide fast and read-only cache for XSLT processing and XPath data model.
  • The OnItemDataBound method of the DataGrid control is used to raise the ItemDataBound event that occurs after a data item is bound to the control.
  • The AutoGenerateColumns property is used to get or set a value that indicates whether or not the BoundColumns object are automatically created and displayed in the DataGrid control for each field in a data source.
  • The PermitOnly method of the FileIOPermissionAccess class is used to prevent callers higher in the call stack from using the code that calls this method to access resources that are not specified by the current instance.
  • The xml data type is a built-in data type in SQL Server 2005. As with other built-in data types such as int and varchar, a user can define the xml data type on a column when he creates a table.
  • The proper approach to synchronize a DataSet object with an XmlDataDocument object is to first populate the DataSet object with data and then to synchronize it with the XmlDataDocument object.
  • The Commit, Rollback, and Save methods are defined in the SqlTransaction class.
  • The Load method of the XmlDocument class is used to load the contents of an XML file into an XmlDocument object. However, it does not perform document type definition (DTD) or schema validation.
  • The Save method of the XmlDocument class is used to save an XML document to a specified file or location.
  • The GetChildRows method of the DataRow class is used to get the child rows of a DataRow object.
  • The XmlNode class derived from the System.Xml namespace is a representation of a single node in an XML document. It is the base class in the XML DOM, and supports XPath selections and provides editing capabilities.
  • The ImportNode method of the XmlDocument class is used to import the node from another XML document.
  • An XmlReader class is created to display the XML file from a database.
  • The IDataAdapter interface allows an object to implement the DataAdapter class.
  • The AllowDBNull property of the DataColumn class returns a value to indicate whether null values are allowed in the column to retrieve specified data records.
  • The inner join is used to retrieve records from two tables that are combined and added to a query’s result set. The result can be retrieved only when the values of the joined fields meet a specified criteria.
  • The XML Schema Definition tool (Xsd.exe) converts data formats, such as DataSets and classes, to XML schemas and vice versa.
  • The LineNumber property that is inherited from the XmlSchemaObject class, specifies the line number referred to by a schema element in a file.
  • The SqlCommand class represents a Transact-SQL statement or stored procedure to be executed at a SQL Server database.
  • The CommandText property of the SqlCommand class specifies the stored procedure or SQL statement that is to be executed at the data source.
  • The XmlDocument class is used to create an in-memory tree object containing an XML hierarchical node structure and related data. It loads and saves an XML document and accesses all the nodes in the document.
  • The MinPoolSize clause of the ConnectionString property of the SqlConnection class is used to specify the minimum objects in the connection pool.
  • The Relations property of the DataSet class specifies the collection of data relations that link two or more tables.
  • The SqlDataReader class avoids creating unnecessary objects or making unnecessary copies of data. Hence, it provides optimal performance.
  • The Procedure property of the SqlError class is used to return the name of the stored procedure or Remote Procedure Call (RPC) from which an error has generated.
  • The xsi:noNamespaceSchemaLocation attribute is an XML schema instancing (XSI) attribute that is used when an XML document needs to be validated.
  • The xsi:schemaLocation attribute is an XML schema instancing (XSI) attribute that can be used to validate contents in an XML file.
  • The <codeBase> element is used only in machine configuration file or in publisher policy file. This element is also used to redirect the assembly version.
  • The <probing> element is used in the application configuration file in order to specify subdirectories in which the common language runtime searches for an assembly.
  • Web Services Description Language (Wsdl.exe) is a tool used to generate code for XML Web services and Web service clients from WSDL, XSD schema files, and discovery documents.
  • The CacheDuration property of the WebMethod attribute specifies the number of seconds for which the response should be held in the cache. The default value for this property is zero.
  • The FOR XML AUTO clause is used with the SELECT statement to return a query result as an XML document. This clause forces SQL Server to generate XML documents automatically using defaults.
  • The XMLDATA clause is used to retrieve XML datatype information.
  • The Select method of the XPathNavigator class is used to select the set of nodes and returns an object of the XPathNodeIterator class.
  • The Compile method of the XPathNavigator class is used to compile a string that represents an XPath expression.
  • The XmlDocument class that defines within the System.Xml namespace is used to represent an XML document.
  • The <xs:key> element specifies that the field or column on which a key constraint is specified must have unique values and must contain no null values.
  • The <unique> element specifies that a value of an attribute or element must be unique within the specified scope. The name attribute of the <unique> element defines the name of the unique element and must be unique within an identity constraint set.
  • Left outer join produces all records from the left table with the matching records from the joined table.

Testing and Debugging

  • During unit testing, a developer takes the smallest unit of an application, isolates it from the rest of the application code, and tests it to determine whether it works as expected.
  • The following are the advantages of Unit testing:
    1. A large percentage of defects can be identified during the process of Unit testing.
    2. It enhances the process of testing, as the elementary units of the application are tested separately.
    3. It reduces the cost of testing, as small special programs such as test drivers and stubs can be reused during the whole process of testing.
    4. It also simplifies the process of debugging, as it limits the search for errors to a small unit of the application, instead of searching the whole of the application.
  • The Regression testing is used to make sure that no new errors are found in an application. It can be performed any time when a program needs to be modified either to add a feature or to fix an error.
  • Testing a software aims at fulfilling each and every requirement specified in the software specification. A test plan can be defined as a formal document that guarantees that the software has been tested thoroughly, meets user requirements, and has no defects.
  • The EventLogTraceListener class directs tracing or debugging output to the event log.
  • The Debug and Trace classes share the same Listeners collection. Therefore, if a listener object is added to either of the two, it will work for both the classes.
  • The Fail method of the Trace class displays errors only if the default trace listener is present in the listeners collection.
  • The WriteLineIf method is used to write information to the trace listeners with a new line character if a condition is true.
  • The Switch class provides trace switches to control the level of testing.
  • The TextWriterTraceListener class is used to redirect output to a TextWriter or a Stream object.
  • The WriteLine method of the Trace class writes information about the trace to the trace listeners.
  • A try block must be accompanied by at least one catch block or one finally block.
  • The EventLogTraceListener class provides a listener that directs debugging or tracing output to an EventLog.
  • The TraceSwitch class provides a multilevel switch to control trace and debug output. It does not require recompiling the code. It can be used to specify whether or not tracing occurs in the application code.
  • The <trace> element of the application’s Web.config file is used to ensure that the trace output is appended to the bottom of each page.
  • The <customErrors> element of the Web.config file provides information about custom error messages for ASP.NET applications.
  • The mode attribute of the <customErrors> element is used to specify whether custom errors are enabled, disabled, or shown only to remote clients.
  • The Trace.axd Http handler is used to view the trace details of an application by setting the value of requestLimit=””[n]”” in the application’s configuration file.
  • The Warn method of the TraceContext class writes warning messages in red color to the trace log.
  • The Write method of the TraceContext class writes trace messages (excluding warning messages) to the trace log.
  • The pageOutput attribute sets the value to true if the trace information is displayed both on an application’s pages and in the .axd trace utility, otherwise it sets the value to false.
  • The TraceError property of the TraceSwitch class returns true if Level is set to Error, Warning, Info, or Verbose; otherwise it returns False.
  • The TraceWarning property of the TraceSwitch class returns true if Level is set to Warning, Info, or Verbose; otherwise it returns False.
  • The Cordbg.exe and DbgCLR.exe tools are used to debug .NET applications.
  • When a debugger is attached to a running service, the current functioning of the Web service will be interrupted. As soon as the debugger starts its debugging, the service does not actually stop or pause the service’s processing. Instead, it is still in the start mode when the application is debugged, but the service process has actually been suspended.
  • A Windows service is a process that executes in the background and in its own process space with a specific user identity. Usually, it does not involve any user interaction.
  • The AfterSerialize stage occurs just after a SoapMessage is serialized but before the SOAP message is sent over the wire.
  • The Output debugging window is used to display status messages at runtime. Its content is cleared each time the application is compiled or run.
  • In order to debug a Windows service, first of all it is started and then a debugger is added to the process in which the service is running.
  • The <compilation> element of the Web.config file is used to configure compilation settings of ASP.NET.
  • The Al.exe tool is used to compile .resources files into satellite assemblies.
  • In order to create a satellite assembly from .resx and .resources files, first of all convert the .resx file to a .resources file by using the Resgen.exe tool. Secondly, these two .resources files are then compiled into a satellite assembly by using the Al.exe tool.
  • The Watch window is used to see the values of variables within different scopes, i.e., module level, procedure level, and global variables.
  • The Call Stack debugging window is used for viewing the list of currently active procedure calls.
  • The Data breakpoint breaks the execution of the program and causes the program to change the value of a variable available in the source code of an application.
  • The Cordbg.exe tool is used to debug an application from a command prompt. It provides command-line debugging services. It also helps to find and fix bugs in programs that target the .NET Framework common language runtime.
  • The Immediate window debugging window displays information that results from debugging statements in the code, or the information requested by typing commands directly into the window. It can be used to view the value of variables at run-time.
  • A project’s build configuration specifies how the project in a solution is to be built and deployed. Setting the Configuration property to Debug generates a program database file (.pdb) that contains information about symbols used within the application on compiling the project.
  • The QuickWatch dialog box is used to quickly examine and evaluate variables and expressions for debugging.
  • When a debugger is attached to an XML Web service, the call from a calling code can time out indicating that the debugging process cannot be continued. As a result, an error message will be raised along with an exception of the type ‘System.Net.WebException’. To resolve this issue, the timeout value for the XML Web service call should be set to infinite (or -1).

Deploying Windows Services, Serviced Components, .NET Remoting Objects, and XML Web Services

  • The .NET Framework Services Installation (Regsvcs.exe) tool is used to manually register an assembly containing a serviced component.
  • Manual registration is used for design-time testing to find out the types of errors that may occur at runtime.
  • In dynamic registration, an assembly with a serviced component is copied into the COM application’s directory. Dynamic registration is used only when a managed client creates a serviced component.
  • Programmatic registration is used to register an assembly, containing a serviced component, programmatically by creating an instance of the RegistrationHelper class.
  • Registering a serviced component either using manual registration, dynamic registration, or programmatic registration.
  • If a Web service is inaccessible from the computer or network on which it is installed, the Web Services Description Language (Wsdl.exe) tool can be used to create the proxy class manually. This proxy class file is then added to the application project.
  • The following are the various features of .NET deployment:
    1. By default, multiple applications do not share components.
    2. Multiple applications need to explicitly make the components available for sharing by assigning a strong name to an assembly.
    3. No-impact applications isolate an application and remove DLL conflicts.
    4. Private components have no impact on other applications.
    5. Side-by-side versioning deploys multiple versions of a component or an application.
  • The Common Language Runtime finds the assembly through the codebase setting. If no match is found in the location as specified in the <codebase> element in the application configuration file, the binding request fails. Then the CLR tries to find the assembly through probing.
  • The <requiredRuntime> tag is used in the configuration file of an application to specify the version of a common language runtime used to execute an application.
  • Type Library Importer (Tlbimp.exe) tool is used to convert the type definitions from a COM type library into equivalent definitions in a common language runtime assembly.
  • An application uses the System.Data namespace to connect to a database.
  • The Launch Condition tab in the Project Properties dialog box is used to specify conditions for installation. These conditions can be used in conjunction with a file, registry, or component search. They can be used to terminate the installation if the specified item is not found.
  • The User Interface Editor is used to view and edit user interface dialog boxes that are displayed during the application installation on the target computer.
  • The Installutil.exe tool can be used to install multiple assemblies at a time. It performs installation in a transactional manner.
  • The Resgen.exe tool can be used to perform the following tasks:
    1. Convert .txt files to .resources or .resx files.
    2. Convert .resx files to .txt or .resources files.
    3. Convert .resources files to .txt or .resx files.
  • The Windows Explorer allows installation and uninstallation of assemblies in the Global Assembly Cache by using drag and drop and menu operations.
  • Web service discovery is a preliminary process for accessing a Web site. It locates Web service descriptions.
  • Through the discovery process, Web service clients know about the existence of a Web service, its capabilities, and how to interact with it.
  • The following tasks performed by the Regsvcs.exe tool during the manual registration of an assembly are as follows:
    1. Load and register the assembly.
    2. Generate the type library.
    3. Call the LoadTypeLibrary method.
    4. Install the type library into the COM application.
  • The FileMajorPart property of the FileVersionInfo class returns the major part of the version number of a file.
  • Publisher policy is a set of rules, which enables vendors to establish compatibility among different versions of an assembly or a shared component. It can be used to redirect assembly references from one version to another, and to deploy service packs such as updates of an assembly or a shared component.
  • For deploying shared assemblies, the binding policy that is a set of rules determines the place to search for the assembly and version to bind to the application. The searching process of the CLR involves the following three stages of the binding policy resolution:
    1. Application policy resolution
    2. Publisher policy resolution
    3. Administrator policy resolution
  • The CLR determines the correct version of an assembly by examining the application configuration file, the publisher policy file, and the machine configuration file.
  • The following are the different approaches on how the correct version of an assembly is specified in the assembly manifest:
    1. Include the AssemblyVersion() attribute in an application’s source code.
    2. Update the AssemblyVersion() attribute in the AssemblyInfo file of an application.
    3. Include the System.Reflection namespace in the project when the AssemblyVersion() attribute is included in the application’s source code.
  • The Web application directory, WebService.asmx file, and Web.config file are the components of Web service, which are published on the Web while deploying an XML Web service.
  • The User Interface editor allows a developer to change the visual screen, which the user sees while installing the application.
  • The <authentication> tag is used to configure ASP.NET authentication support.
  • Basic authentication is used to authenticate users on the Internet and enables a browser to prompt the user for a username and password.
  • Authorization determines whether or not a principal is allowed to perform a requested action.
  • The IsSubSetOf method of the PrincipalPermission class is used to determine whether or not the current permission object is a subset of the specified permission object.
  • The FileAuthorizationModule module is used when the authentication mode attribute is set to Windows in the element and checks against the access control list (ACL).
  • The GenericPrincipal class represents a generic principal. The GenericIdentity class represents a generic identity. Both the classes are used in conjunction with each other to create an authorization scheme. These two classes can be used to prompt users for their user names and passwords, to check these values against a database, and to create principal and identity objects.
  • The UrlAuthorizationModule class of the System.Web.Security namespace is used to provide URL-based authorization services to allow or deny access to specified resources.
  • The EnableSession property of the WebMethod attribute is used to specify whether or not the data stored in Session object is available. Setting this property to True will store session state in the ASP.NET HttpSessionState object.
  • The WebResponse class derived from the System.Net namespace is used to provide a response from a Uniform Resource Identifier (URI).
  • The WebRequest class derived from the System.Net namespace is used to make a request to a Uniform Resource Identifier (URI).
  • Basic authentication requires remote users to use a valid Windows NT account name and password to access the Web server.
  • The SoapHeaderAttribute class is used to specify a SOAP header so that the Web methods that implement this class are able to process data passed to the SOAP header.
  • The Demand method of the CodeAccessPermission class forces a SecurityException exception during runtime whenever any user who has no permission to have an access a particular resource.
  • Integrated Windows authentication is a method of authentication that uses the security features of Windows clients and servers. It is more secure than Basic or Digest authentication. It relies on Internet Explorer and does not work over HTTP proxies.
  • The Server Application of the COM application is used to provide high level security to the component.
  • The ComponentAccessControl, ApplicationAccessControl, SecureMethod, and SecurityRole attributes can be implemented in a component for configuring security.
  • The GetCurrent method of the WindowsIdentity class returns a WindowsIdentity object representing the current Windows user.
  • The IsInRole method of the WindowsPrincipal class is used to determine whether or not the current principal belongs to a specified Windows user group.
  • The principal object of the IPrincipal interface is used during the authentication process. It contains information about a user’s identity such as username and password. It also contains information about a user’s role such as manager or associate.
  • The <authorization> element is used to configure ASP.NET authorization support.
  • The Union method of the PrincipalPermission class is used to create a permission object that is the union of the current permission object and a target parameter permission object.
  • The WindowsIdentity and WindowsPrincipal are classes of the System.Security.Principal namespace. To use these classes without any error, the System.Security.Principal namespace needs to be imported.
  • The SecurityAction.RequestOptional value requests for additional and optional permissions of the assembly.
  • In the Packet Privacy authentication level, authentication and encryption of data are performed. This level includes data integrity and the identity and signature of a user.
  • The ComponentAccessControl component attribute is used to enable or disable access checks at the component level. This attribute applies to a class and its configured default value is set to true.
  • The Microsoft Passport service is an online service that is used by the Passport authentication provider for user authentication. The passport to indicate authenticated users uses an encrypted mechanism.
  • Digest authentication is a secure authentication method in which passwords are sent across a network as a hash value, rather than as clear text.
  • The Custom Authentication with SOAP headers is suitable for both secure and nonsecure Internet scenarios. For user authentication, the user credentials in encrypted format are passed within the SOAP header of the SOAP message.
  • The Windows authentication provider authenticates users on the basis of their Windows accounts.

Comments are closed.