Web Developer Framework 4.0 Sample Questions – 9

Question: You create a Visual Studio 2010 solution that includes a WCF service project and an ASP.NET project. The service includes a method named GetPeople that takes no arguments and returns an array of Person objects. The ASP.NET application uses a proxy class to access the service. You use the Add Service Reference wizard to generate the class. After you create the proxy, you move the service endpoint to a different port. You need to configure the client to use the new service address. In addition, you must change the implementation so that calls to the client proxy will return a List<Person> instead of an array. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

  1. In the context menu for the service reference in the ASP.NET project, select the Configure Service Reference command, and set the collection type to System.Collections.Generic.List.
  2. In the context menu for the service reference in the ASP.NET project, select the Update Service Reference command to retrieve the new service configuration.
  3. Change the service interface and implementation to return a List<Person>.
  4. Edit the address property of the endpoint element in the web.config file to use the new service address.

Correct Answer: 1 & 4


Question: You use the ASP.NET Web Application template to create an application in a new Visual Studio solution. The project uses types that are defined in a class library project. Source code for the class library is frequently modified. You need to ensure that classes in the Web application project always reference the most recent version of the class library types. What should you do?

  1. Add the class library project to the solution. Modify the class library project to add a reference to the Web application project.
  2. Add the class library project to the solution. Modify the Web application project to add a reference to the class library project.
  3. Add a post-build step to the Web application project that copies the most recent version of the class library assembly to the bin folder of the Web application.
  4. Add a post-build step to the class library project that copies the most recent version of the class library assembly to the App_Code folder of the Web application. In the <compilation /> section of the web.config file, add an <assembly /> entry that specifies the location of the class library assembly.

Correct Answer: 2


Question: You use the ASP.NET Web Site template to create a Web site that will be deployed to multiple locations. Each location will specify its SMTP configuration settings in a separate file named smtp.config in the root folder of the Web site. You need to ensure that the configuration settings that are specified in the smtp.config file will be applied to the Web site. Which configuration should you use in web.config?

  1. <configuration><system.net><mailSettings><smtp configSource=”smtp.config” allowOverride=”true”><network host=”127.0.0.1″ port=”25″/></smtp></mailSettings></system.net> </configuration>
  2. <configuration><system.net><mailSettings><smtp configSource=”smtp.config” /></mailSettings></system.net> </configuration>
  3. <configuration xmlns:xdt=”http://schemas.microsoft.com/XML-Document-Transform”><location path=”smtp.config” xdt:Transform=”Replace”xdt:Locator=”Match(path)”><system.net /></location> </configuration>
  4. <configuration><location path=”smtp.config”><system.net><mailSettings><smtp deliveryMethod=”Network”><network host=”127.0.0.1″ port=”25″/></smtp></mailSettings></system.net></location> </configuration>

Correct Answer: 2


Question: You are developing an ASP.NET application by using Visual Studio 2010. You need to interactively debug the entire application. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

  1. Set the Debug attribute of the compilation node of the web.config file to true.
  2. Add a DebuggerDisplay attribute to the code-behind file of the page that you want to debug.
  3. Select the ASP.NET debugger option in the project properties.
  4. Define the DEBUG constant in the project settings.

Correct Answer: 1 & 3


Question: You deploy an ASP.NET application to an IIS server. You need to log health-monitoring events with severity level of error to the Windows application event log. What should you do?

  1. Run the aspnet_regiis.exe command.
  2. Set the Treat warnings as errors option to All in the project properties and recompile.
  3. Add the following rule to the healthMonitoring section of the web.config file. <rules><add name=”Failures”eventName=”Failure Audits”provider=”EventLogProvider” /> </rules>
  4. Add the following rule to the healthMonitoring section of the web.config file. <rules><add name=”Errors”eventName=”All Errors”provider=”EventLogProvider” /> </rules>

Correct Answer: 4

Tagged . Bookmark the permalink.

Leave a Reply