A problem about programming com+ in c#

  • Thread starter Thread starter Jet
  • Start date Start date
J

Jet

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 ApplicationAccessControl property
in the assambley.Enable application security in default.
Actually, I have declare an interface in my code, and the component class
has inherits it, like this:
class A:ServiceComponent,Imyinterface
{
....
}
interface Imyinterface{
...
}
Why the system also warm me this? How can I solve this problem?
 
Jet said:
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 ApplicationAccessControl
property
in the assambley.Enable application security in default.
Actually, I have declare an interface in my code, and the component class
has inherits it, like this:
class A:ServiceComponent,Imyinterface
{
....
}
interface Imyinterface{
..
}
Why the system also warm me this? How can I solve this problem?

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
(ApplicationAccessControl ), that means COM+ will use the default.

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

Willy.
 
Jet said:
Why the system also warm me this? How can I solve this problem?

The ApplicationAccessControl warning is telling you that you have not
used the ApplicationAccessControl 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:ApplicationAccessControl(true)]

For the other warning, see this:

http://www.dotnet247.com/247reference/msgs/19/99958.aspx
 
Back
Top