A problem about programming com+ in c#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jet

    A problem about programming com+ in c#

    Hi all,
    I have written a com+ component by c#,and when I register it into com
    service it thorw me a warmming mean "There isn't interface of this class in
    class testCom.objCom, so it can't use AutoComplete method when binding by
    unmanagement code.
    And it also warm me that haven't decalere ApplicationAcce ssControl property
    in the assambley.Enabl e application security in default.
    Actually, I have declare an interface in my code, and the component class
    has inherits it, like this:
    class A:ServiceCompon ent,Imyinterfac e
    {
    ....
    }
    interface Imyinterface{
    ...
    }
    Why the system also warm me this? How can I solve this problem?


  • Willy Denoyette [MVP]

    #2
    Re: A problem about programming com+ in c#


    "Jet" <liang_yj@126.c om> wrote in message
    news:uJ9BIaTWFH A.1468@tk2msftn gp13.phx.gbl...[color=blue]
    > Hi all,
    > I have written a com+ component by c#,and when I register it into com
    > service it thorw me a warmming mean "There isn't interface of this class
    > in
    > class testCom.objCom, so it can't use AutoComplete method when binding by
    > unmanagement code.
    > And it also warm me that haven't decalere ApplicationAcce ssControl
    > property
    > in the assambley.Enabl e application security in default.
    > Actually, I have declare an interface in my code, and the component class
    > has inherits it, like this:
    > class A:ServiceCompon ent,Imyinterfac e
    > {
    > ....
    > }
    > interface Imyinterface{
    > ..
    > }
    > Why the system also warm me this? How can I solve this problem?
    >
    >[/color]

    Both are warnings only, the first warns you about the fact that your class
    cannot be accessed by native COM clients because you didn't apply the
    required attributes, this is not a problem if you intend to use the
    component from .NET clients only.
    The second warns you about a missing security attribute
    (ApplicationAcc essControl ), that means COM+ will use the default.

    If more details are required you have to post the code, or read the chapters
    about ServicedCompone nt attributes in MSDN.

    Willy.


    Comment

    • Steve Walker

      #3
      Re: A problem about programming com+ in c#

      In message <uJ9BIaTWFHA.14 68@tk2msftngp13 .phx.gbl>, Jet
      <liang_yj@126.c om> writes
      [color=blue]
      >Why the system also warm me this? How can I solve this problem?[/color]

      The ApplicationAcce ssControl warning is telling you that you have not
      used the ApplicationAcce ssControl attribute to set the COM+ application
      security, and it is defaulting it to enabled. This is the "enforce
      access checks for this application" tickbox on the security tab of the
      application properties in the Component Services explorer. If you are
      going to manually configure the app through that, or you want security
      on anyway, don't worry about it.

      To set it, add this to the AssemblyInfo file:

      [assembly:Applic ationAccessCont rol(true)]

      For the other warning, see this:



      --
      Steve Walker

      Comment

      Working...