C ++ / CLI:CA2123:需要SecurityCriticalAttribute? [英] C++/CLI: CA2123: Requires SecurityCriticalAttribute?
问题描述
我对这样的错误有点失落:
警告7 CA2123:Microsoft.Security
:添加以下内容安全属性
到
'RithmicConnector :: Connect(String ^)'
为了匹配基于
上的LinkDemand方法'IConnector :: Connect(String ^)':
'SecurityCriticalAttribute'。 c:\work\\\
ettecture\tradex\source\tradex.connectivity.rithmic\rithmicconnector.cpp 52 Tradex.Connectivity.Rithmic
我在哪里添加SecurityCriticalAttribute?
我试过在头文件 - 但是错误不会消失。我有一个很大的一个(托管C ++)接口DLL的每个暴露的方法。
我想让CA运行。
$ b $您必须执行两项操作:
- 将
- 将[SecurityCritical]属性添加到包含关键代码的特定方法(或您想要装饰的任何其他方法)。
以下是可能有帮助的博客条目使用透明度在CLR
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
You'll have to do two things:
- Add [assembly: SecurityCritical] to the assembly.
- 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
这篇关于C ++ / CLI:CA2123:需要SecurityCriticalAttribute?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!