Abstract InjectionMemberElement object cannot be created

Case: Azure webapp. Solution with multiple projects that uses unity.

Working fine on localhost but not when published, getting the message:

An error occurred creating the configuration section handler for unity: An abstract InjectionMemberElement object cannot be created. Please specify a concrete type.”

Unity is defined in the web.config as:

<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
</configSections>
</configuration>

<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
...
</unity

Isolved it by renaming the unity tags to “unityX” so I suspect that the IIS already has loaded unity from another referenced project in the solution.

After the renaming it doesn’t work locally cause it then can’t find and load unity. But that’s another issue…

 

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.