MonoDevelop Compilation & GAC

落花浮王杯 提交于 2019-12-24 09:59:55

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/8980105/monodevelop-compilation-gac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!