How do you package dll's in the GAC

Topics: General
Aug 2, 2012 at 7:11 PM

I have created a package on our local NuGet repository but need to include Oracle.DataAccess.dll and Oracle.Web.dll.  These dll's reside in the GAC.  What is the best way to make sure they get packaged?  I tried to use an absolute path but that didn't work.  I also tried creating a solution folder, copying the dll's into a physical folder that matched the solution folder and pointing to that.  No dice.

Any help would be nice. 

Thanks!

Aug 2, 2012 at 7:15 PM

I am referring to what I put in my .nuspec, specifically as a child of the <files> element. Or maybe there is a different way?

Aug 2, 2012 at 7:19 PM

Can you paste the contents for you .nuspec file? It should work with absolute path.

Aug 2, 2012 at 7:30 PM

You know, I got it to work.  Thanks for the tip.  The problem was that I uninstalled the package incorrectly so there was a reference to the package hanging around somewhere.  Maybe in the solution file?  All I did was delete the packages.config and delete the reference to the dll.  But I installed it at the solution level.  Not sure what happened, I'm new to NuGet.

Aug 2, 2012 at 7:56 PM

There is a 'packages' folder at the solution root where we store a copy of the .nupkg file if at least one project still references that package.

Btw, whenever you create a new package, it's always a good idea to check the content of it to make sure it contains the right files. There's a tool called NuGet Package Explorer then help you view the package content visually. You can install it here: http://nuget.codeplex.com/releases/view/59864

Aug 3, 2012 at 2:12 PM
Thanks for the info. I will do that. BTW, Oracle.Web.dll has a dependency on System.Web.dll. I tried adding System.Web to the <files> node but it never seems to package the dll. I used the path in the properties of the reference in my project. Does NuGet not package FCL libraries?
Thanks,
Evan A. Bonnett
Sr Software Developer, Kennedy Space Center/NASA
Abacus Technology Corp
321-867-7336 - work
321-863-6750 - cell
evan.a.bonnett@nasa.gov
Aug 3, 2012 at 3:18 PM

The nuspec has a special support for framework assembly references. Do not use the <files> element to package those assemblies.

See more details in the Specifying Framework Assembly References section on this page:

http://docs.nuget.org/docs/reference/nuspec-reference

Aug 3, 2012 at 4:31 PM
That is good info and I have bookmarked that document. Not to be a pest but one more question. Should I be using <references> to reference my Oracle.DataAccess.dll? I tried but it said the following:
Invalid assembly reference 'Oracle.DataAccess.dll'. Ensure that a file named 'Oracle.DataAccess.dll' exists in the lib directory.
Or is using the <file> the preferred method to bring in dll’s that are not framework assemblies?
Thanks!
Developer
Aug 3, 2012 at 5:09 PM

If you expect the Oracle binaries to be present in the GAC on all boxes that are going to install the package, you should use the references node. My guess is this would be the case - I think the binary comes with other native dependencies and might not work when simply bin deployed.