确定 CLR 系统目录
有关 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 mscoree.dll 本地导出 - GetCORSystemDirectory()
native export from mscoree.dll - GetCORSystemDirectory()
您可以检查 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.