2

I am currently having an issue with Event System when I include a reference to another class inside my Event System class on Tridion 2011 instances (replicated on both 2011 SP1 Hotfix 2 and 2011 SP1 Hotfix 1). The referenced class is inside another project (same solution, using C# VS2012).

I've set up Event system by following the steps outlined here: http://elenaserghie.blogspot.com/2013/02/setup-sdl-tridion-2011-event-system-2011.html

The error being displayed:

Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

The stacktrace:

Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Unable to Initialize TDSE object. Initialization of the extension 'C:\Program Files (x86)\Tridion\bin\TridionNotifyTest.dll' failed.

TridionNotifyTest.EventSystem..ctor() System.RuntimeTypeHandle.CreateInstance(RuntimeType,Boolean,Boolean,Boolean&,RuntimeMethodHandleInternal&,Boolean&) System.RuntimeType.CreateInstanceSlow(Boolean,Boolean,Boolean,StackCrawlMark&) System.RuntimeType.CreateInstanceDefaultCtor(Boolean,Boolean,Boolean,StackCrawlMark&) System.Activator.CreateInstance(Type,Boolean) System.Activator.CreateInstance(Type) Tridion.ContentManager.Extensibility.TcmExtension.LoadExtensions() Tridion.ContentManager.Extensibility.TcmExtension.LoadExtensions() Tridion.ContentManager.Extensibility.TcmExtension.InitializeExtensions() Tridion.ContentManager.Session.InitializeSession() Tridion.ContentManager.Session..ctor(String,String,UserContext) Tridion.ContentManager.BLFacade.SystemFacade.InitializeUserContext(UserContext,String,String) UtilitiesTDS.GetUserContext TDSE.Initialize

Here's the Event system constructor:

public EventSystem()
{
      Class1 test = new Class1(); // when this line is commented out Tridion does not show the above error
      Subscribe();
}

The error happens no matter where Class1 is included.

Here's some more info about the issue:

  • I've got it working in a 2013 instance (using the 2013 dll's from bin/client)
  • The path inside the Tridion.ContentManager.config extensions tag points to the Program Files (x86)/Tridion/bin folder, which contains both the EventSystem project dll and the ClassLibrary1 dll
  • Both the EventSystem project and the ClassLibrary1 project are Class Libraries using .NET Framework 4.5 (4.5.1 is installed on the server), and Tridion's app pool on the server is set to v4.0
  • After creating the ClassLibrary1 project in VS2012 (solution -> add new project -> class library) no additional references have been added
  • The only references added to the EventSystem project are the required Tridion references (taken from bin/client) and the ClassLibrary1 project:
    • **Tridion.Common.dll
    • Tridion.ContentManager.dll
    • Tridion.ContentManager.Common.dll
    • Tridion.ContentManager.Publishing.dll
    • ClassLibrary1**
  • ClassLibrary1 contains Class1.cs which has a string property with a getter/setter and nothing else

Other things I've tried:

My question is: Why is Tridion complaining about a missing assembly when no additional references have been added to ClassLibrary1?

1 Answer 1

1

Perhaps this will give you the clue to the problem:

Initialization of the extension 'C:\Program Files (x86)\Tridion\bin\TridionNotifyTest.dll' failed.

What I take away from this is that your Tridion.ContentManager.config specifies the path to this Event System DLL. In your DLL listing you mention: "ClassLibrary1". Did you rename your DLL/Project, but left the Tridion config reference? Or perhaps you typoedmisspelled the DLL name/path in the config.

5
  • Hi Nickoli, thanks for the response. I've got 2 different projects/dlls, TridionNotifyTest.dll(contains Event System class) and ClassLibrary1.dll (contains a public class with a string property). TridionNotifyTest references ClassLibrary1, and both dll's are currently inside the x86/Tridion/bin folder. I've only included a path to the TridionNotifyTest.dll in the config. I don't believe this is a typo because when I remove the line inside the Event System Constructor (shown in code block above) Tridion does not complain about TridionNotifyTest.dll
    – jgambino
    May 9, 2014 at 23:20
  • You most likely need to put place your lib DLL in the GAC May 11, 2014 at 18:43
  • @NickoliRoussakov Why is the directory of the executing assembly ignored? May 12, 2014 at 20:03
  • @NVanderEnde, good point. It should work in the same dir. I just realized I've answered the exact same question here: tridion.stackexchange.com/a/2163/159. There must be some other issue. Do the version, culture and public key token match up from what is on the assembly vs what the error message states Tridion is looking for? May 12, 2014 at 21:22
  • @NickoliRoussakov The version, culture, and public key token all match up between the assembly and the error message from Tridion.
    – jgambino
    May 14, 2014 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.