gpt4 book ai didi

c# - 什么是 C# 中的透明类或透明方法?`

转载 作者:行者123 更新时间:2023-11-30 20:46:34 25 4
gpt4 key购买 nike

我有 C# 代码,当我针对它运行 FXCop 时,它会产生一个奇怪的错误,我试图理解这个错误,但我无法理解。错误说

Transparent Methods Must Not Satisfy Link Demands.

这里我不明白的是什么是透明方法?在浏览 MSDN 帮助时,我遇到了一个名为透明类的术语。

谁能解释一下透明类透明方法是什么意思?

最佳答案

引自msdn页面http://msdn.microsoft.com/en-us/library/ee191569(v=vs.110).aspx

Transparency is an enforcement mechanism that separates code that runs as part of the application from code that runs as part of the infrastructure. Transparency draws a barrier between code that can do privileged things (critical code), such as calling native code, and code that cannot (transparent code). Transparent code can execute commands within the bounds of the permission set it is operating in, but cannot execute, derive from, or contain critical code.

关于c# - 什么是 C# 中的透明类或透明方法?`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26730517/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com