views:

150

answers:

1

I am a little lost on erros like that:

Warning 7 CA2123 : Microsoft.Security : Add the following security attribute to 'RithmicConnector::Connect(String^)' in order to match a LinkDemand on base method 'IConnector::Connect(String^)': 'SecurityCriticalAttribute'. c:\work\nettecture\tradex\source\tradex.connectivity.rithmic\rithmicconnector.cpp 52 Tradex.Connectivity.Rithmic

Where do I add the SecurityCriticalAttribute?

I tried on the header file - but the error does not disappear. I have one of those pretty much on every exposed method of a (managed C++) interface DLL.

And I want CA to run through.

How do I fix those?

Regards

A: 

You'll have to do two things:

  1. Add [assembly: SecurityCritical] to the assembly.
  2. Add [SecurityCritical] attribute to the specific methods containing critical code(or whatever else you wish to decorate).

Here's a blog entry that might be helpful Using Transparency in CLR

Joe