Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can's see my methods in component services

Status
Not open for further replies.

harmmeijer

Programmer
Mar 1, 2001
869
CN
I have created a serviced component with 2 public subs, after installing it the application shows in component services but the public methods don't show. I am not able to add or remove roles to or from methods

here is some code:
assamblyinfo.vb
Code:
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.EnterpriseServices

<Assembly: AssemblyTitle("")> 
<Assembly: AssemblyDescription("")> 
<Assembly: AssemblyCompany("")> 
<Assembly: AssemblyProduct("")> 
<Assembly: AssemblyCopyright("")> 
<Assembly: AssemblyTrademark("")> 
<Assembly: CLSCompliant(True)> 

<Assembly: Guid("62B75D65-8062-48C1-AE53-6E60D480FBF3")> 


<Assembly: ApplicationName( _
"test serviced component")> 
<Assembly: Description("My description")> 
<Assembly: ApplicationActivation(ActivationOption.server)> 
<Assembly: AssemblyKeyFile("..\..\sclib.snk")> 
<Assembly: ApplicationAccessControl(True, _
    AccessChecksLevel:=AccessChecksLevelOption.ApplicationComponent _
    )> 
<Assembly: AssemblyVersion("1.0")>

testClass.vb
Code:
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.EnterpriseServices
Imports System.Runtime.InteropServices

<ComponentAccessControl(True), _
        SecurityRole("NotThisOne", True) _
> _
Public Class testClass
    Inherits ServicedComponent
    <SecurityRole("NotThisOne", True), SecureMethod() _
    > _
    Public Sub aaaa1()
        MsgBox("this is aaaa1")
    End Sub

    <SecurityRole("NotThisOne", True)> _
    Public Sub aaaa2()
        MsgBox("this is aaaa2")
    End Sub
End Class

from the project folder started the following command:
sn -k sclib.snk

compiled the project
In the bin folder executed the following command:
regsvcs SCLib.dll

The application shows in mmc component services but when I
drill down to my methods I can't see them

(test serviced component -> SCLib.testClass -> _testClass -> Methods

I can start both methods however so the serviced component does run, when I remove the <SecurityRole("NotThisOne", True)> attribute from aaaa2 it doesn't raise a permission denied error.



Greetings, Harm Meijer
 
Seems that I have to set the following attribute for the class:
ClassInterface(ClassInterfaceType.AutoDual)



Greetings, Harm Meijer
 
True. You need that attribue.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top