As a developer at your company, you are creating a serviced component that will perform several distributed transactions across different databases. The serviced component will be called from managed and unmanaged client applications.You create a new class library project. You write code in the class modules to implement the logic.You want to detect and correct any registration errors before any client applications use the component.What should you do next?
A.Assign a strong name to the assembly. Compile the assembly. Run the .NET Services Installation tool (Regsvcs.exe) to add the component to Component Services
B.Run the Type Library Exporter (Tlbexp.exe) to export the definition for the assembly
C.Assign a strong name for the assembly. Compile the assembly. Run the Global Assembly Cache tool (Gacutil.exe) to add the component to the global assembly cache
D.Use the Assembly Registration tool(Regasm.exe) to create entries in the registry that describe the assembly
试卷相关题目
- 1You are creating a serviced component named Itemlnventory. An online catalog application will use Itemlnventory to display the availability of products in inventory.Additional serviced components written by other developers will continuously update the inventory data as orders are placed.The Item Inventory class includes the following code segment: <Transaction(TransactionOption.Required)>Public Class Itemlnventory Inherits ServicedComponent 'Method code goes here.End ClassItemlnventory is configured to require transactions. You want Item Inventory to respond to requests as quickly as possible, even if that means displaying inventory values that are not up to date with the most recent orders.What should you do?
A.To the Itemlnventory class, add the following attribute:
B.To all methods of the Itemlnventory class, add the following attribute:
C.Modify the Transaction attribute of the Itemlnventory class to be the following attribute:
D.Modify the Transaction attribute of the Itemlnventory class to be the following attribute:〈Transaction(TransactionOption.Required, __IsolationLevel:» TransactionlsolationLevel.ReadOncoromitted)>
开始考试点击查看答案 - 2You are creating an XML Web service named ViewOrders that is available to customers over the Internet. ViewOrders exposes a Web method named ViewShippingDetail that requires additional security. You decide to use generic role-based security to secure ViewShippingDetail.You need to write code to ensure that once the caller is authenticated, a user identity named Generic is created. This user identity has membership in a group named Shipping to allow access to ViewShippingDetail .Which code segment should you use?
A.Dim myldentity As IIdentity = New GenericIdentity("Generic”, "Custom")Dim Roles As String() = {"Shipping"}Dim myPrincipal = New GenericPrincipal(myldentity, Roles)ir.yldentity = Windowsldentity. Get Current
B.Dim myldentity As Genericldentity = New_Genericldentity("Generic", "Custom")Dim Roles As String () = {"Shipping"}Dim myPrincipal = New GenericPrincipal(myldentity,_ Roles) Thread.CurrentPrincipal = myPrincipal
C.Dim myldentity As Ildentity = New_Genericldentity("Generic", "Shipping")Dim myPrincipal As 工Principal = New_WindowsPrincipal(myldentity)Threa
D.CurrentPrincipal = myPrincipalD.Dim myGenericIdentity As Ildentity = New_Genericldentity(”Generic", "Custom")Dim myldentity As Windowsldentity = myGenericIdentity Dim Roles As String() = {"Shipping"}Dim myPrincipal = New GenericPrincipal(myldentity,_Roles)Windowsldentity.Impersonate(myldentity.Token)
开始考试点击查看答案 - 3You create an assembly that contains a collection of serviced components. You want to secure these components by using a collection of COM+ roles. Different group of roles will secure different components.You need to ensure that role-based security is enforced in the assembly. You want to accomplish this goal by adding an attribute to the project source code.Which attribute should you use?
A.〈assembly: SecurityRole("Assembly", true)>
B.〈assembly:SecurityPermission(SecurityAction.RequestOptional)>
C.〈assembly:ApplicationActivation(ActivationOption.Server)>
D.〈assembly:AppiicationAccessControl(AccessChecksLevel = AccessChecksLevelOption.ApplicationComponent)>
开始考试点击查看答案 - 4You are developing an application by using Visual C# .NET and Visual Basic .NET. The application will use functions form a DLL written in unmanaged code.One function requires the calling application to allocate unmanaged memory, fill it with data, and pass the address of the memory to the function . On returning from the function, the calling application must deallocate the unmanaged memory.You need to decide how your application will handle unmanaged memory.What should you do?
A.Use a byte array
B.Use the methods of the Marshal class
C.Use the methods of the MemoryStream class
D.Derive a new class from the Stream class, and override the allocation methods
开始考试点击查看答案 - 5You are creating an XML Web service named YourWebService. Callers must be authenticated by using credentials passed in the SOAP header of each Web service call. You want to use role-based security to secure each method on YourWebService. The roles that users are assigned are stored in a custom database table.You need to write code that will allow you to dynamically change which roles can execute specific methods at run time.What should you do?
A.Create a Windowsldenti ty object and a Windows Principal Object. Then implement declarative role-based security
B.Create a Windowsldenti ty object and a Windows Principal object. Then implement imperative role-based security
C.Create a Gene riel dentity object and a GenericPrincipal object. Then implement declarative role-based security
D.Create a Genericldentity object and a GenericPrincipal object. Then implement imperative role-based security
开始考试点击查看答案