gac_msil design intent and operation

Jun 11, 2009 at 8:43 PM

Can anyone fill us in on the design intent behind the gac_msil directory where NPanday keeps Windows assemblies?  It doesn't appear to be recognized by Windows as a "real" Global Assembly Cache like C:\WINDOWS\assembly.  Is it simply used as a repository by NPanday by convention? 

When I build a .NET project with NPanday it will install the resulting binary in both the maven repository and in gac_msil (~\.m2\repository and ~\.m2\uac\gac_msil) but with different naming conventions.  Why both, why not just the maven repository or just gac_msil?

If a Visual Studio project references a dll (e.g. NLog) I can simply create a directory structure in gac_msil, following the naming convention of other stuff there, copy the nlog.dll in there and then NPanday will find it with a depencency section like this in the pom:

  <dependency>
      <groupId>NLog</groupId>
      <artifactId>nlog.dll</artifactId>
      <version>1.0</version>
      <type>library</type>
    </dependency>

But that's obviously a back door hack to getting something installed in gac_msil.  Isn't there some maven command I should be running to do that?  I worked through the wiki article on packaging binaries, but deploy:deploy-file only puts binaries in the maven repository.  The biggest problem with the current 1.0.0 installer, by the way, is that it does not build gac_msil on the target machine.

Last question, can I set up a remote gac_msil repository, as I might set up remote maven repositories?  What do I put in settings.xml or npanday-settings.xml to point NPanday at a remote gac_msil?  And would it then download artifacts to the local gac_msil per usual maven behavior?

Thanks very much for your help,

Wally

Developer
Jul 14, 2009 at 9:23 PM

> Why both, why not just the maven repository or just gac_msil?

This has to do with the naming requirements for .NET.  I'm not an expert on this, but as I understand it, the dependency chain is baked into the dll, and you cannot change the filename (for example, to include a version number.)  Since Maven requires the version number in the filename for its local repository, there had to be a way to get back to the version-less filenames, and this is what the original developer chose.  Back at NMaven I believe Brett did some work to make it possible to use only the ~/.m2/repository but I'm not sure whether that came over to NPanday.

> If a Visual Studio project references a dll (e.g. NLog) I can simply create a directory structure in gac_msil,following the naming convention of other stuff there, copy the nlog.dll in there and then NPanday will find it with a depencency section like this in the pom

Actually, no.  The gac_msil has a companion directory rdf_repository which serves as an index of its content.  You can't manually add/delete from gac_msil, you must use the build process (the install plugin).

> Last question, can I set up a remote gac_msil repository, as I might set up remote maven repositories?

You don't need to -- NPanday is meant to be used with a "normal" remote Maven repository.

-Wendy