确定 CLR 系统目录

发布于 2024-07-15 19:23:37 字数 423 浏览 3 评论 0原文

有关 C# 命令行的 MSDN 文章编译器 /lib 开关指定以下内容:-

编译器按以下顺序搜索未完全限定的程序集引用:

  • 当前工作目录。 这是调用编译器的目录。

  • 公共语言运行时系统目录。

  • /lib 指定的目录。

  • LIB环境变量指定的目录。

如何以编程方式确定 CLR 运行时系统目录在系统上的位置?

The MSDN article on the C# command-line compiler /lib switch specifies the following:-

The compiler searches for assembly references that are not fully qualified in the following order:

  • Current working directory. This is the directory from which the compiler is invoked.

  • The common language runtime system directory.

  • Directories specified by /lib.

  • Directories specified by the LIB environment variable.

How do you programmatically determine where the CLR runtime system directory is located on the system?

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

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

发布评论

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

评论(2

眼藏柔 2024-07-22 19:23:37

从 mscoree.dll 本地导出 - GetCORSystemDirectory()

native export from mscoree.dll - GetCORSystemDirectory()

孤独岁月 2024-07-22 19:23:37

您可以检查 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\InstallRoot 以查找 .Net 运行时的位置。

您可以使用 Microsoft.Win32.Registry 类。

You might check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\InstallRoot to find the location of the .Net runtime.

You can access the registry using the Microsoft.Win32.Registry classes.

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