skip to content »

Updating the gac

updating the gac-77

Or you’ve changed the code in a feature receiver, and you experience that the old code is executed instead of a new one when you deploy. Because when a process loads an assembly from the Global Assembly Cache, it will keep using that version of the assembly for the rest of its life .Solution deployment is run by the Share Point 2010 Timer service, and features are activated within your Power Shell process.

Right click on the project, select Assembly Information and then changed the dll and file version, then build the wsp file and installed on the production server.Using is one, but this comes as part of a Visual Studio installation, and in a server environment, you may not have the luxury of installing Visual Studio, just to get the utility installed. Gac Install("C:\Path\To\DLL.dll") #If installing into the GAC on a server hosting web applications in IIS, you need to restart IIS for the applications to pick up the change. An alternative, however, is to use Power Shell to install the DLL into the GAC. Yes this time it did the trick code changes were reflecting on the application pages on the production site.The only problem was change the dll version and make sure that in the gac it has latest version installed.This makes your development environment more like real life, which is a Good Thing.

And as I showed earlier, you can use different build configurations to choose between different deployment scenarios: Full reinstall, upgrade from previous version, etc.

So you may be headed for a nasty surprise when you take your solution to a test server for the first time, and discover there are all sorts of upgrade scenarios to consider.

(For instance, it’s really difficult to overwrite existing files.) If you use a Power Shell script to deploy from Visual Studio, you can use that same script in development, test and production.

(Update: The timer service problem described here happens when you retract a solution, then reinstall it with a new feature receiver, or a feature receiver with a changed name.

The problem does not occur when you update an already installed solution.

(There may be other processes to consider in other scenarios – check the Share Point logs to see which process is performing which operations.) Why isn’t this a problem when you do Visual Studio deployment?