Activation error occurred while trying to get instance of type EPiDashboardController Exception

I’ve had this error a few times, usually when trying to install an exisiting Episerver website:

2016-11-21 14:45:15,586 ERROR [82] *******.Application_Error – Error caught in global.asax
EPiServer.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type EPiDashboardController, key “” —> StructureMap.StructureMapException: StructureMap Exception Code: 207
Internal exception while creating Instance ‘bfa8cfc3-aae9-4405-bae7-86e03db460b8’ of PluginType EPiServer.Shell.ViewComposition.IViewManager. Check the inner exception for more details. —> System.ArgumentException: Unable to find a module by assembly ‘******, Culture=neutral, PublicKeyToken=null’

This error prevents the editor from loading and all you see is a blank screen whenever you try and log into the editor. This error can be a bit misleading and a bit annoying, as a) the issue is never a structure map issue and b) there isn’t an easy way to find out what’s gone wrong. The first time I got this error it was because the CMO wasn’t installed correctly. I was either missing an assembly or one of the web.config settings hadn’t been applied correctly. The last time I had this error was pretty random. I needed to register my websites assembly in the modules.config, like:

<?xml version="1.0" encoding="utf-8"?>
<module loadFromBin="false" name="ReloadChildren" clientResourceRelativePath="" tags="EPiServerModulePackage">
<add assembly="Website.Assembly" />
<add name="reload-children" path="ClientResources" />
<add name="menupin" path="Scripts/MenuPin" /></paths>
<clientModule initializer="reload-children/Initializer">
<add dependency="CMS" type="RunAfter" />

I added the section and after that the editor started working as expected. If you’ve got a similar issue, then based on my experience, it’s probably a plug-in/add-on issue and this is the area you should try to fix. A EPiDashboardController error means that something probably isn’t registered correctly and Episerver requires some configuration information to be present in the web.config before it can be used, Episerver can’t talk to something, or you have missing plug-in files, or you have the wrong version of some files. Some quick Googling found that someone has solved this issue by applying the IUSER permission to the webroot. If you are still reading this I would first try adding the assembly the exception is moaning about within a  section in your module.config. If that doesn’t work try going through removing anything non-standard within module.config and hopefully you should be able to find what’s breaking your site!

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

More Posts

4 replies
  1. Matthew Boniface
    Matthew Boniface says:

    It’s so weird and annoying.. I am getting this error only in my Azure deployed app. It only happens when trying to upload media – in the UI it just says “Failed”. I have to inspect the response from the editor UI’s POST to and it comes back with a 200 status but error message “Activation error occurred while trying to get instance of type ContentTypeRepository, key \”\””.

    I’m pretty sure StructureMap is okay because everything else is working.. Is there anything special anyone knows about ContentTypeRepository that could be causing this?

  2. Matthew Boniface
    Matthew Boniface says:

    Okay, I figured this out! 🙂

    First things to clear up that I didn’t realise:
    *This was also happening on my local, not just Azure, but it hadn’t been happening previously which lead me to believe it was only broken in Azure.. Which leads me to:
    *I believe this started happening after I upgraded the solution to episerver v10.x (I was on v9.x before)

    What I figured out is that if I called ServiceLocator.Current.GetInstance() it would get:
    “No default Instance is registered and cannot be automatically determined for type ‘EPiServer.DataAbstraction.ContentTypeRepository’
    There is no configuration specified for EPiServer.DataAbstraction.ContentTypeRepository”

    So, I realised that something in the media upload meant there was a call to service locator asking for ContentTypeRepository. So I simply added this to my DependencyResolverInitialization code (structuremap configuration):

    And voilà! It is all happy now :)Hope this helps someone if they stumble into this (I googled and couldn’t find anyone with this exact exception).


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *