Microsoft UPG:Transition MCPD.NET Frmwrk 3.5 Web Dev to 4 Web Dev Sample Questions:
1. You are adding a Windows Communication Foundation (WCF) service to an existing application. The
application is configured as follows. (Line numbers are included for reference only.)
01 <configuration>
02 <system.serviceModel>
03 <services>
04 <service name="Contoso.Sales.StockService"
05 behaviorConfiguration="MetadataBehavior">
06 <host>
07 <baseAddresses>
08 <add baseAddress="http://contoso.com:8080/StockService" />
09 </baseAddresses>
10 </host>
11 </service>
12 </services>
13 <behaviors>
14 <serviceBehaviors>
15 <behavior name="MetadataBehavior">
16 </behavior>
17 </serviceBehaviors>
18 </behaviors>
You need to configure the service to publish the service metadata.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A) Add the following XML segment between lines 10 and 11. <endpoint address="" binding="mexHttpBinding" contract="IMetadataExchange"
/>
B) Add the following XML segment between lines15 and 16. <serviceDiscovery> <announcementEndpoints> <endpoint address=""/>
</announcementEndpoints>
</serviceDiscovery>
C) Add the following XML segment between lines 15 and 16 <serviceMetadata httpGetEnabled="true"/>
D) Add the following XML segment between lines 10 and 11. <endpoint address="" binding="basicHttpBinding" contract="IMetadataExchange"
/>
2. 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.)
A) Set the Debug attribute of the compilation node of the web.config file to true.
B) Add a DebuggerDisplay attribute to the code-behind file of the page that you want to debug.
C) Define the DEBUG constant in the project settings.
D) Select the ASP.NET debugger option in the project properties.
3. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Communication Foundation (WCF) Data Services service. The service connects to a Microsoft SQL Server 2008 database. The service is hosted by an Internet Information Services (IIS) 6.0 Web server.
The application works correctly in the development environment. However, when you connect to the service on the production server, attempting to update or delete an entity results in an error. You need to ensure that you can update and delete entities on the production server. What should you do?
A) Add the following line of code to the InitializeService method of the service. config.SetEntitySetAccessRule ("*",EntitySetRights.WriteDelete | EntitySetRights.WriteInsert);
B) Add the following line of code to the InitializeService method of the service. config.SetEntitySetAccessRule ("*",EntitySetRights.WriteDelete | EntitySetRights.WriteMerge);
C) Configure IIS to allow the PUT and DELETE verbs for the .svc Application Extension.
D) Configure IIS to allow the POST and DELETE verbs for the .svc Application Extension.
4. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use
the ADO.NET Entity Framework to model entities. You write the following code segment. (Line numbers
are included for reference only.)
01AdventureWorksEntities context = New AdventureWorksEntities (http://localhost:1234/AdventureWorks.
svc );
02
03var q = from c in context.Customers
04where c.City == "London"
05orderby c.CompanyName
06select c;
You need to ensure that the application meets the following requirements: "Compares the current values of
unmodified properties with values returned from the data source. "Marks the property as modified when the
properties are not the same. Which code segment should you insert at line 02?
A) context.MergeOption = MergeOption.NoTracking;
B) context.MergeOption = MergeOption.PreserveChanges;
C) context.MergeOption = MergeOption.AppendOnly;
D) context.MergeOption = MergeOption.OverwriteChanges;
5. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application updates several Microsoft SQL Server databases within a single transaction. You need to ensure that after a resource failure, you can manage unresolved transactions. What should you do?
A) Call the EnlistVolatile method of the Transaction class.
B) Call the Reenlist method of the TransactionManager class.
C) Call the RecoveryComplete method of the TransactionManager class.
D) Call the EnlistDurable method of the Transaction class.
Solutions:
| Question # 1 Answer: A,C | Question # 2 Answer: A,D | Question # 3 Answer: C | Question # 4 Answer: B | Question # 5 Answer: B |
We're so confident of our products that we provide no hassle product exchange.


By Tobey

