4

I am trying to port a small console application from Windows/.NET to Ubuntu/Mono. I have problems to add a reference to the mono version of NLog, which I added to the GAC.

Adding NLog.dll to the assembly was confirmed: Installed NLog.dll into the gac (/usr/lib/mono/gac)

I also find it in the GAC under: /usr/lib/mono/gac/NLog/2.0.0.0__5120e14c03d0593c

First I thought that it was due to my umask 027. But I changed files to 644 and directories to 755. The problem persists.

I am working with: Ubuntu 10.04, Monodevelop 2.2.1, Mono version 2.4.4 (Debian 2.4.4~svn151842-1ubuntu4), Nlog NLog2.mono2-Beta1

Do you have any idea?

Peter P.
  • 191
  • 1
  • 6

1 Answers1

4

The Edit References dialog does not show assemblies registered in the GAC, but assemblies registered by packages using a .pc file. That's explained in the MonoDevelop FAQ.

The GAC is an assembly registry meant to be used at run-time, not at development time. If your application depends on another assembly, that assembly either has to be provided by a package (and advertised through a .pc file) or has to be bundled together with your application. In the later case, you can just use a project or 'file' reference to the assembly.

user436465
  • 56
  • 1
  • Thank you for making me aware of that! – Peter P. Oct 22 '10 at 17:37
  • 1
    Doesn't work for me. Using MonoDevelop 2.4.1, Mono 2.8.1, Mac OSX (10.6.5), Recently installed Tao framework into 1 of 3 PKG_CONFIG_PATH-listed directories, which includes the default /usr/lib/pkgconfig (where the various Toa*.pc files live). I've tried moving the variable's export line from /etc/bashrc to /etc/profile to ensure it is more widely available AND I've even tried hard coding the same export value into the MonoDevelop.app bundle's internal start-up script, but to NO avail. When I try to edit references, the alphabetical list stops at 'S' (for System.*), no 'T' for Toa.*. Ideas?. – Big Rich Jan 09 '11 at 00:14
  • It appears that the 'package assemblyName' argument of gacutil/gacutil2 isn't creating a link to the assembly within '/usr/lib/mono' during installation to the GAC. My TAO*.pc pkgconfig files point to this directory, but there is nothing there. Raising the permissions using Sudo either directly on the gacutil call, or the Tao Nant build file, which contains the original gacutil call, does nothing to eleviate this. Guess I'll have to make the *.dll links manually. – Big Rich Jan 09 '11 at 05:52
  • @BigRich Any suggestions for [this query](http://stackoverflow.com/q/34893893/2404470)? – Zameer Ansari Jan 20 '16 at 08:21
  • 1
    @student, apologies, I haven't been a user of Mono since my comments above (that was for a particular project), more focussed on Java/Scala/JVM nowadays. I hope my comments above help and you find your answer. – Big Rich Jan 20 '16 at 10:16