Exam Prep Questions

Question 1

You have created a database-driven Web application. Using Microsoft SQL Server, you have also generated an installation script for your database and stored it in a file named InstData.sql . You want to deploy this application on a Web server. When the application is deployed, the database should also be created on the same server. You are creating a Web setup project using Visual Studio .NET. Which of the following actions should you take to create the database while deploying your application on the Web server?

  • A. Create a component that derives from the Installer class, and override its Install() method to create the database. Add the component to the Install node of the Custom Actions Editor in the Web setup project.

  • B. Create a component that derives from the Installer class, and override its Install() method to create the database. Add the component to the Commit node of the Custom Actions Editor in the Web setup project.

  • C. Copy the InstData.sql file to the Application folder on the target machine's file system using the File System Editor. Add InstData.sql to the Install node of the Custom Actions Editor in the Web setup project.

  • D. Create a component that derives from the Installer class, and override its Install() method to create the database. Add the component to the Launch Conditions Editor in the Web setup project.

A1:

The correct answer is A. You can use the Custom Actions Editor to perform custom actions such as database installation during the application setup. If you have an Installer class or program that creates a database, it must be added to the Install node of the Custom Actions Editor. Answer B is incorrect because the Commit() method is called after the Install() method has been successfully run. Usually, to avoid raising exceptions, no processing is done in the Commit() method. Answer C is incorrect because only executable or script files can be added to the Custom Actions Editor. Answer D is incorrect because the Launch Conditions Editor is used only to determine whether a prerequisite is met before the installation can continue.

Question 2

You have created a Web application that uses some components not shared by other applications. Each of these components is packaged in its own assembly, each of which has a strong name associated with it. The application that uses these components is not required to load a specific version of these components. You do not want to store the assemblies directly under the application's installation folder. Which of the following options is the best approach for deploying these assembly files?

  • A. Store the components in the GAC.

  • B. Store the components anywhere you like and specify the path to them using the < codebase > element in the application's configuration file.

  • C. Store the assemblies in one of the subdirectories under the application's installation directory, and specify this subdirectory as part of the <probing> element in the application's configuration file.

  • D. Store the components in the Windows system directory.

A2:

The correct answer is C. In the given scenario, the components are not shared between multiple applications and the applications are not specific about versions, so a good place to store the assemblies is a folder inside each application's installation folder, with its location specified via the <probing> element in the application's configuration file. Answer A is incorrect because, if the components are not shared between applications, they don't have to be stored in the GAC. Answer B is incorrect because, although you could use the <codebase> element in the application's configuration file, you would have to specify a certain version for the assembly. Answer D is incorrect because CLR does not search for the assemblies in the Windows system directory.

Question 3

When you install a Web application on a target machine, you want to store the Readme.txt file in the application installation directory selected by the user . You also want to create a shortcut for the Readme.txt file on the desktop of the target machine. While creating a Web setup project, which of the following actions will you take in the File System Editor to achieve this? (Select all that apply.)

  • A. Move the shortcut to the Readme.txt file from the Web Application folder to the user's desktop in the target machine's file system.

  • B. Add the Readme.txt file to the Web Application Folder node of the target machine's file system.

  • C. Create a shortcut to the Readme.txt file in the Web Application Folder node of the target machine's file system.

  • D. Add the Readme.txt file to the user's desktop in the target machine's file system.

  • E. Move the shortcut to the Readme.txt file from the user's desktop to the Web Application folder in the target machine's file system.

A3:

The correct answers are A, B, and C. To copy the Readme.txt file to the installation directory selected by the user at install time, you must add it to the Web Application folder in the target machine's file system. To create a shortcut, you first create a shortcut to the Readme.txt file stored in the Web Application folder in the target machine's file system. Then, you move this shortcut from the Web Application folder to the user's desktop in the target machine's file system. Answer D is incorrect because this action deploys the Readme.txt file, rather than its shortcut, on the user's desktop. Answer E is incorrect because you want to move the shortcut from the Web Application folder to the user's desktop, but this action does just the opposite .

Question 4

You are a developer in a large manufacturing company and are developing a complex inventory control application with a team of 15 other developers. You have written two program modules, inv1234.cs and inv5678.cs , which are also used with several other applications in the company. You compiled both the program modules using the Visual C# .NET compiler, producing inv1234. netmodule and inv5678.netmodule files. You now want to link the compiled modules into an assembly that you will install in the GAC to test the Web forms that depend on this assembly. You have decided to keep the name of the assembly as InvLib.dll . You have access to your company's public key but not the private key. The public key is stored in a file named BigCoPublic.snk . When the testing is completed, your project manager will use the private key (stored in a BigCoPrivate.snk file) to fully sign all the assemblies in the accounting software application. Which of the following commands would you choose to successfully sign your assembly?

  • A.

    [View full width]
     
    [View full width]
    al.exe inv1234.netmodule,inv5678.netmodule /delaysign /keyfile:BigCoPublic.snk /out: graphics/ccc.gif InvLib.dll
  • B.

    [View full width]
     
    [View full width]
    al.exe inv1234.netmodule,inv5678.netmodule /delaysign+ /keyfile:BigCoPublic.snk /out: graphics/ccc.gif InvLib.dll
  • C.

    [View full width]
     
    [View full width]
    al.exe inv1234.netmodule,inv5678.netmodule /delaysign- /keyfile:BigCoPublic.snk /out: graphics/ccc.gif InvLib.dll
  • D.

     csc.exe inv1234.cs,inv5678.cs /delaysign /keyfile:BigCoPublic.snk /out:InvLib.dll 
A4:

The correct answer is B. You can use the al.exe command to link already compiled modules into an assembly. The process of including a public key in an assembly and signing it with a private key at a later stage is called delay signing. You can perform delay signing on an assembly using al.exe with the /delay+ switch. Answers A and C are incorrect because the /delaysign and /delaysign- options are equivalent and are used only if you want to fully sign an assembly using both the private key and public key. Answer D is incorrect because the C# compiler ( csc.exe ) does not provide options for the signing of assemblies.

Question 5

You are using the Installer tool ( installutil.exe ) to install server resources by executing the installer components in three assemblies. You issued the following command:

 installutil Assembly1.exe Assembly2.exe Assembly3.exe 

During the execution of this command, the installation of Assembly3.exe failed. Which of the following will happen?

  • A. Only Assembly1.exe will be installed.

  • B. Only Assembly2.exe will be installed.

  • C. Both Assembly1.exe and Assembly2.exe will be installed.

  • D. None of the assemblies will be installed.

A5:

The correct answer is D. installutil.exe performs installation in a transactional manner. If one of the assemblies fails to install, it rolls back the installations of all the other assemblies. Answers A, B, and C are incorrect because, if the installation of Assembly3.exe fails, none of the assemblies will be installed.

Question 6

You have developed a Web custom control that will be used to provide consistent navigation links across all your company's Web applications. These applications will be developed by many developers and deployed across multiple servers. The Web custom control should be installed in the GAC. Which method should you use for deploying this control?

  • A. Merge module

  • B. FTP deployment

  • C. Setup project

  • D. Web setup project

A6:

The correct answer is A. The merge module can be incorporated into the setup projects of other applications and can perform advanced operations such as inserting assemblies in the GAC. Answer B is incorrect because FTP deployment cannot register the control's assembly in the GAC. Answers C and D are incorrect because a setup or Web setup project cannot be merged with other setup projects.

Question 7

You are deploying a mission-critical Web application for your company. Which of these configurations will enable your application to continue functioning even if a critical hardware component such as a power supply fails? (Select two.)

  • A. Single-server deployment

  • B. Web farm deployment

  • C. Web garden deployment

  • D. Cluster deployment

A7:

The correct answers are B and D. Web farm and cluster deployments use multiple servers to provide redundancy and hardware fault tolerance to an application. Answers A and C are incorrect because single-server and Web garden installations place the application on a single physical server, where a failure of a critical hardware component can bring down the whole application.

Question 8

You want to create a customized setup program for a Web application. One of the screens shown during installation should be available only from the administrative installation of the Microsoft Windows Installer package. Other setup options are available for regular as well as administrative installations. Which of the following editors will enable you to create such an installation program?

  • A. File System Editor

  • B. User Interface Editor

  • C. Custom Actions Editor

  • D. Launch Conditions Editor

A8:

The correct answer is B. You can customize the user interface of an installation program using the User Interface Editor for the regular installation and administrative installation. Answer A is incorrect because the File System Editor is useful only for establishing file associations on the target computer. Answer C is incorrect because the Custom Actions Editor is useful only for specifying additional actions to be performed on the target computer at the end of an installation. Answer D is incorrect because the Launch Conditions Editor is useful only for specifying conditions that must be met to successfully run an installation.

Question 9

You work as a software developer for a big pharmacy and are writing some components that will be shared across several applications throughout the company. You want to place an assembly named CommonComponents.dll in the GAC for testing purposes. You do not have access to the company's private key, but you have stored the company's public key in the assembly manifest of CommonComponents.dll . Which of the following commands are you required to run to place your assembly in the GAC? (Select all that apply.)

  • A. sn.exe “Vr CommonComponents.dll

  • B. sn.exe “Vu CommonComponents.dll

  • C. gacutil.exe /i CommonComponents.dll

  • D. gacutil.exe /u CommonComponents

A9:

The correct answers are A and C. You must first turn off the verification for partially signed assemblies. You can do this using the sn.exe tool with the “Vr switch. Next, you install the assembly to the GAC using the /i switch with the gacutil.exe command. Answer B is incorrect because the “Vu option of sn.exe unregisters an assembly for verification skipping, thereby turning on the verification. Answer D is incorrect because the /u option of gacutil.exe is used to uninstall an assembly from the GAC.

Question 10

A Web application is already deployed to your company's production Web server when you discover a logic error in the Visual C# .NET code-behind file for one of the application's Web forms. You have corrected the error and rebuilt the application on the test server. What is the easiest way to transfer the changes to the production server?

  • A. Use FTP to move the changed files to the production server. Then restart the WWW service on the production server.

  • B. Build a Windows Installer project to install the entire application, and run the Installer project on the production server. Then restart the WWW service on the production server.

  • C. Use FTP to move the changed files to the production server. Do not restart the WWW service on the production server.

  • D. Build a Windows Installer project to install the entire application. Then run the Installer project on the production server, but do not restart the WWW service on the production server.

A10:

The correct answer is C. If a Web application is already installed on IIS, you can simply replace any updated files. ASP.NET will detect the changed files and automatically recompile the pages as clients request them. Answers A and B are incorrect because there is no need to restart the WWW service on the production server. Answer D is incorrect because the deployment of the code-behind Web forms can be easily done by FTP and building a Windows Installer project is unnecessary.



MCAD Developing and Implementing Web Applications with Visual C#. NET and Visual Studio. NET (Exam [... ]am 2)
MCAD Developing and Implementing Web Applications with Visual C#. NET and Visual Studio. NET (Exam [... ]am 2)
ISBN: 789729016
EAN: N/A
Year: 2005
Pages: 191

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net