We have a local Sitecore 9.0.2 installation that is relatively vanilla. It is currently failing to load the Configuration Manager because of the following error message.
Server Error in '/' Application. Unable to activate type 'Sitecore.Marketing.xMgmt.Observers.Activation.PublishItemObserver`1[Sitecore.Marketing.Definitions.Campaigns.ICampaignActivityDefinition]'. The following constructors are ambigious: Void .ctor(Sitecore.Marketing.xMgmt.Observers.IPublishTargetResolver, Sitecore.Marketing.IItemRepositoriesSettings) Void .ctor(Sitecore.Marketing.xMgmt.Observers.IPublishTargetResolver, Sitecore.Data.Database) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Unable to activate type 'Sitecore.Marketing.xMgmt.Observers.Activation.PublishItemObserver`1[Sitecore.Marketing.Definitions.Campaigns.ICampaignActivityDefinition]'. The following constructors are ambigious: Void .ctor(Sitecore.Marketing.xMgmt.Observers.IPublishTargetResolver, Sitecore.Marketing.IItemRepositoriesSettings) Void .ctor(Sitecore.Marketing.xMgmt.Observers.IPublishTargetResolver, Sitecore.Data.Database)
This error goes away when we disable EXM in the Web.config.
More specifically, this error goes away if we comment out the Event Handlers loaded in the Sitecore.EmailExperience.ContentManagement.config
listed here.
<events>
<event name="item:added">
<handler type="Sitecore.Modules.EmailCampaign.Core.ItemEventHandler, Sitecore.EmailCampaign" method="OnItemAdded" resolve="true" />
</event>
<event name="item:copied">
<handler type="Sitecore.Modules.EmailCampaign.Core.ItemEventHandler, Sitecore.EmailCampaign" method="OnMessageCopied" resolve="true" />
</event>
<event name="item:created">
<handler type="Sitecore.Modules.EmailCampaign.Core.RootItemEventHandler, Sitecore.EmailCampaign" method="OnRootCreated" resolve="true" />
</event>
<event name="item:deleted">
<handler type="Sitecore.Modules.EmailCampaign.Core.RootItemEventHandler, Sitecore.EmailCampaign" method="OnRootDeleted" resolve="true" />
<handler type="Sitecore.Modules.EmailCampaign.Core.ItemEventHandler, Sitecore.EmailCampaign" method="OnItemDeleted" resolve="true" />
</event>
<event name="subscriber:assigned" />
</events>
EDIT: This is happening in all environments now, so no longer environmental.
Obviously, the fix isn't to keep EXM disabled or to comment out these event handlers.
Does anyone have an answer as to how to solve ambiguous constructor issues, like this one above?