.NET deployment for dll assemblies and added to the GAC...

Posted on 2014-04-18
Medium Priority
Last Modified: 2014-04-18
I have come across a major issue that I cannot seem to resolve...we have to come up with a way to deploy a bunch of dll files to a persons desktop with little to no interaction.  Can here is that you need to register them in the GAC for them to work and be used.

From what I understand through my testing:

PowerShell can accomplish this but is very complicated and there is not guarantee that it will be installed on the client box.
XCOPY cannot register things in the GAC in say using a bat file to copy from a network location
MSI installers are not longer an option in .NET 2012 but you can use the InstallShield, which doesn't register in the GAC
You can copy the gacutil.exe to the client box but that will create issues with license agreements, versioning, etc...

So here I am, an MVC/ASP.NET Webforms and WPF developer trying to figure out how to get this to work.  Surely it cannot be that complicated and I am missing something I would think...

For the project there isn't an "app" so to speak, just dll files that are being transferred ti the client box and then referenced in Excel...

Can someone that has experience in this topic please tell me what I am missing here?

Thanks in advance!

Question by:cyimxtck
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 40

Expert Comment

by:Vadim Rapp
ID: 40009105
> You can copy the gacutil.exe to the client box but that will create issues with license agreements, versioning, etc

I don't think it would.

>  but you can use the InstallShield, which doesn't register in the GAC

It does, see http://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx

Also, depending on  the purpose, maybe it's not necessary to put them in GAC. If they are going to be used by one application, xcopy to the app directory will do it.
LVL 40

Expert Comment

by:Vadim Rapp
ID: 40009139
...yet another way is to install WiX add-on into Visual Studio, and create the installation in it. The article "Installing Assemblies for Runtime and Design-time Use"  has the details.
LVL 12

Accepted Solution

jmcmunn earned 1500 total points
ID: 40009221
I've used Wix, Installshield and gacutil in various projects and they all work fine putting stuff in the gac.

If you can't (or don't want to) get the dll's in the Gac you can deploy them to the application directory (or bin directory of a web site) and they will get loaded and used just fine.  There is no reason you HAVE to put something in the Gac unless it is an artificial limitation put on the dll by the creator (or consumer) of the dll.

If the purpose is to share the same version of the dll and have windows help with managing the version etc, then that is exactly the purpose of the gac.

In visual studio 2012 and 2013 you can installe the LE version of Installshield and it can put things in the Gac...it is free last I checked.
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!


Author Comment

ID: 40009268
Not sure I get what you're saying:

Gacutil.exe is only for development purposes and should not be used to install production assemblies into the global assembly cache.

It must be in the GAC and this will not do the job:

It does, see http://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40009309
Can here is that you need to register them in the GAC for them to work and be used.
OK, so I'm very curious:  Why would this be?

Author Comment

ID: 40009315
Don't register them in the GAC and it doesn't work.  Register them and it works.

Not sure the reason why and we don't have time to evaluate the why but only time for the HURRY UP AND GET THIS DONE!!!  lol
LVL 40
ID: 40009736
Something that nobody seems to have stated in this thread is that you need to be an administrator to install something in the GAC. It also requires that the dlls be signed. And if you install a new version of a dll in the GAC, the older applications won't use it, they will still use the old version unless a redirection is defined somewhere in the .NET loading system.

This gives you a little more control about updates, but make them more complicated to manage unless you understand all the little intricacies. This is thus usually not a very good place to store your own dlls. The application directory is usually better.

The main reason for using the GAC if for companies who really know how to use it and want to be able to update a dll used by many applications without having to know where they are installed on the computer.

Featured Post

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
If you don't know how to downgrade, my instructions below should be helpful.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question