Set - 8

Question 36 :

How can be the web application get configured with the following authorization rules
* Anonymous users must not be allowed to access the application.
* All persons except David and John must be allowed to access the application.
o <authorization><allow roles ="*"><deny roles = "?"><</authorization>
o <authorization><deny users = "applicationname\David; applicationname\John" ><deny users = "*"></authorization>
o <authorization><deny users = "applicationname\David, applicationname\John" ><deny users = "?"><allow users ="*"></authorization>
o <authorization><allow users ="*"><deny users = "applicationname\David, applicationname\John" ></authorization>

Answer :

authorization deny users = "applicationname\David, applicationname\John" deny users = "?" allow users ="*" /authorization

Question 37 :

Describe the advantages of writing a managed code application instead of unmanaged one. What's involved in certain piece of code being managed?

Answer :

The advantages include automatic garbage collection, memory management, support for versioning and security. These advantages are provided through .NET FCL and CLR, while with the unmanaged code similar capabilities had to be implemented through third-party libraries or as a part of the application itself.

Question 38 :

Are COM objects managed or unmanaged?

Answer :

Since COM objects were written before .NET, apparently they are unmanaged.
Any code not written in the Microsoft .NET framework environment is UNMANAGED. So naturally COM+ is unmanaged because it is written in Visual Basic 6.

Question 39 :

So can a COM object talk to a .NET object?

Answer :

Yes, through Runtime Callable Wrapper (RCW) or PInvoke.

Question 40 :

How do you generate an RCW from a COM object?

Answer :

Use the Type Library Import utility shipped with SDK. tlbimp COMobject.dll /out:.NETobject.dll or reference the COM library from Visual Studio in your project.