Developing event system modules is all in a day’s work for a Tridion professional. Deploying your modules is simple enough, but can get quite tedious. You need to shut down services, stop IIS, copy some DLLs to the Tridion bin folder, install other DLLs in the GAC, start IIS, restart services…
Today I got fed up so I wrote a windows batch script that automates all that. It isn’t earth-shattering, just a little thing that might help save you a few minutes of your precious time.
It works ONLY with Tridion 2013 by the way. On 2011 and before, you need to shutdown the COM+ as well, and that is not so easy to do.
Here is how to build a package for your event system, and deploy it with the script.
First build the project in Release mode (for DEV you might want to use DEBUG mode!)
Next, create a ‘package folder’. This is simply a folder on your file system that contains one subfolder called ‘gac’ (if you have nothing to install in the GAC, you should leave this out).
Download deploy-eventsys and unblock it. Extract the file deploy-eventsys.bat from the zip and copy it to the package folder
Copy files from Bin\Release into a (newly created) ‘package folder’:
- The primary output of your project
- E.g. My.Events.dll
- The symbols file for your project (only if you built in Debug mode)
- E.g. My.Events.pdb
If there are files you need to store in the GAC, copy them to the ‘gac’ subfolder.
Copy the package to the CM server.
Activitate the event system module in the Tridion configuration.
- Open the file <Tridion Home>\config\Tridion.ContentManager.config in an editor
- Search for <extensions>
- Add the following line inside <extensions>:
- Save and close the file
Right-click on deploy-eventsys.bat and choose ‘Run as administrator’. This will shut down all relevant services, copy the DLL files to the Tridion bin folder, install the gac\*.dll files in the GAC and start the services again.
The script assumes you have installed the Microsoft SDKs, which contain a file called gacutil.exe. It is assumed to be located here:
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
If you keep a copy of gacutil.exe at a different location, please update the bat file.
Otherwise, the script will tell you to install the DLLs in the GAC manually.
When you run the deploy-eventsys.bat script, you may get messages like the following (depending on which services are activated on your system):
If this happens, type Y and press enter.
That’s it. The event system should now be activated. To check, open the Tridion event log and look for a message similar to this:
TCM Extension initialized: My Event System (My.Events)
Files to download