Hi,
This problem is really a jerk. See the following code:
<Assembly: ApplicationActivation(ActivationOption.Library)
<Assembly: ApplicationAccessControl(False)>
<Transaction(TransactionOption.Supported)> _
Public Class ComponentA : Inherits ServicedComponent
Public Sub New()
End Sub
<AutoComplete(True)> _
Public Function GetData(ByVal data As Integer) As
String
Return data.ToString
End Function
End Class
<Transaction(TransactionOption.Supported)> _
Public Class ComponentB : Inherits ServicedComponent
Public Sub New()
End Sub
<AutoComplete(True), Description("Function in
Component B")> _
Public Function GetData(ByVal data As Integer) As
String
Return data.ToString
End Function
End Class
Module COMPlusTest
Public Sub TestA()
Dim ca As New ComponentA()
Dim retVal As String
retVal = ca.GetData(100)
Console.WriteLine("Component A: " & retVal)
Console.ReadLine()
End Sub
Public Sub TestB()
Dim cb As New ComponentB()
Dim retVal As String
retVal = cb.GetData(100)
Console.WriteLine("Component B: " & retVal)
Console.ReadLine()
End Sub
Sub Main()
Try
Console.WriteLine("Testing Component A...")
TestA()
Console.WriteLine("Testing Component B...")
TestB()
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Console.ReadLine()
End Sub
End Module
Why TestA succeeds and TestB throws Method level rolebased
security failed exception????????
Except the description attribute, everything seems to be
the same....
Please, if you know the answer do just tell me.. My email
id is: sr*********@mascon.co.in.