如何检查我的解决方案是否包含非托管代码?

发布于 2024-07-25 23:26:27 字数 156 浏览 3 评论 0原文

我们有很多人致力于一个项目。 是否有任何工具可以扫描并检查我的整个解决方案是否有任何非托管代码或非类型安全代码?

目标是用完全托管的代码托管整个解决方案,找到漏洞并将其修复为类型安全和托管代码。

我需要考虑和处理哪些常见漏洞?

谢谢。

We have a number of people working on a project. Is there any tool that will scan and check my entire solution if it has any unmanaged code or non-typesafe code ?

The objective is to host the entire solution with completely managed code, find the loopholes and fix them to be type-safe and managed code.

What are the common loopholes I will need to consider and deal with ?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

街角迷惘 2024-08-01 23:26:27

PE verify 是检查类型安全性的有用工具。 它本身并不标记非托管代码。 更多信息请访问 http://msdn.microsoft .com/en-us/library/62bwd2yd(VS.80).aspx

PE Verify is a useful tool for checking type safety. It does not flag unmanaged code per se. More information can be found at http://msdn.microsoft.com/en-us/library/62bwd2yd(VS.80).aspx

歌枕肩 2024-08-01 23:26:27

要发现非托管代码,只需在每个项目中禁止不安全代码并查看编译内容即可。

在托管代码中,一切都是类型安全的(因为编译器不会让您进行任何不安全的转换),您正在寻找的是“弱类型”。 您可以首先在 System.Collection 命名空间中搜索类,例如 ArrayListHashTable。 它们不应该再被使用,因为 System.Collection.Generic 命名空间中有强类型的替换。

(在这种情况下,我在弱类型周围使用引号,因为该术语有许多不同的定义,并且我们只是在寻找它的某些方面。)

To spot unmanaged code just disallow unsafe code in each project and see what compiles.

In managed code everything is type safe (as the compiler won't let you do any unsafe casting), what you are looking for is rather "weak typing". You can start by searching for classes in the System.Collection namespace like ArrayList and HashTable. They should not be used at all any more, as there are strongly typed replacements in the System.Collection.Generic namespace.

(I use quotation marks around weak typing in this case, as there are many different definitions of the term, and we are only looking for some aspects of it.)

撩动你心 2024-08-01 23:26:27

也许 MoMA 就是您所需要的。 这应该会给你一些提示。

Maybe MoMA is what you need. This should give you some hints.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文