MonoDevelop编译&广汽集团

发布于 2024-12-28 17:06:54 字数 347 浏览 6 评论 0原文

我对这里发生的事情有点困惑。

我的理解是,当运行时需要程序集时,运行时会首先尝试从执行目录(或依赖的可执行文件所在的目录)加载程序集。之后,它将尝试在 GAC 中查找程序集。

首先,我是在Windows上。

现在,当我在 VS 中编译我的解决方案时,一切工作正常(如预期),但是当我在 MonoDevelop 中编译相同的解决方案时,编译由于与缺少 log4net 引用(我手动为其精确的程序集)相关的错误而停止安装到 GAC 中可以避免这种情况)。

所以,我的问题是:MonoDevelop 是否在编译时查看 GAC 以确定程序集是否可用,或者是否有其他位置需要我提供所需的程序集?

感谢您的帮助!

I'm a bit confused as to what's happening here.

My understanding is that when an assembly is required at runtime, the runtime will first try to load the assembly from the executing directory (or the directory where the dependant executable is located). After which it will attempt to find the assembly within the GAC.

First of all, I am on Windows.

Now, when I'm compiling my solution is VS, everything works fine (as expected), but when I compile the same solution in MonoDevelop, the compilation stops due to errors pertaining to a missing log4net reference (the exact assembly for which I manually installed into the GAC to avoid this situation).

So, my question is this: Does MonoDevelop look at the GAC at compilation time to determine if an assembly is available, or is there another location in which I need to provide the required assembly?

Thank you for your help!

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

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

发布评论

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

评论(1

御弟哥哥 2025-01-04 17:06:54

来自 MonoDevelop 网站

我向 GAC 添加了程序集,当我尝试在 MonoDevelop 项目中添加引用时,为什么它没有出现在程序集列表中?

因为 MonoDevelop 不会在 GAC 中查找程序集。在苹果电脑上
和 Linux 一样,MonoDevelop 使用 pkg-config 来定位已安装的软件包
并获取每个包提供的程序集列表。一个包
指定 .pc 文件中的程序集列表,该文件必须是
安装在标准 pkg-config 目录中。

如果您正在开发一个库,MonoDevelop 可以自动
为您的项目生成 .pc 文件(在项目选项对话框中,
选择“Linux部署设置”,并勾选“生成.pc文件”
选项)。

当在 Windows 上针对 .NET 时,MonoDevelop 使用相同的
VS 使用的 AssemblyFolders 机制。

From MonoDevelop site:

I added an assembly to the GAC, why doesn't it appear in the assemblies list when I try to add a reference in a MonoDevelop project?

Bacause MonoDevelop does not look for assemblies in the GAC. On Mac
and Linux, MonoDevelop uses pkg-config to locate installed packages
and get the list of assemblies that each package provides. A package
specifies this list of assemblies in a .pc file which has to be
installed in the standard pkg-config directory.

If you are developing a library, MonoDevelop can automatically
generate a .pc file for your project (in the project options dialog,
select "Linux Deployment Settings", and check the "Generate .pc file"
option).

When targetting .NET on Windows, MonoDevelop uses the same
AssemblyFolders mechamisn that VS uses.

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