Error: System.InvalidCastException: Unable to cast object of type 'Blackbaud.Web.Content.Core.DynamicDataProvider' - when sending email

When sending an email message in NetCommunity, it results in an Exception. When viewing the details of the status log, you see the following error:

System.InvalidCastException: Unable to cast object of type 'Blackbaud.Web.Content.Core.DynamicDataProvider' to type 'Blackbaud.Web.Content.Core.Data.ShelbyConstituent'.
   at Blackbaud.Web.Content.Core.EmailJob.PopulateRecipient2(IDataProvider oRecipient, String sKey, String sSourceKey, Int32 constituentId)
   at Blackbaud.Web.Content.Core.EmailJob.ProcessImportedList(String sSourceKey, IDataSource oDS, EmailList oList)
   at Blackbaud.Web.Content.Core.EmailJob.ProcessList(Int32 iListID)
   at Blackbaud.Web.Content.Core.EmailJob.ProcessAddressees()
   at Blackbaud.Web.Content.Core.EmailJob.DoProcessMailBlast()
   at Blackbaud.Web.Content.Core.EmailJob.ProcessMailBlast()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.LegacyListProcessorWrapper.PrepareForProcessing()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.BasicEmailDataProcessor.BuildSelectionSQL()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.BasicEmailDataProcessor.BuildRecipientsSelectionSQL()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.EmailProcessor.ProcessEmail()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.ProcessCMSEmailBusinessProcess.StartBusinessProcess()

This can also occur with anonymous newsletter subscriptions being sent out as well.  You may see the below error when sending out an anonymous newsletter. 

System.InvalidCastException: Unable to cast object of type 'Blackbaud.Web.Content.Core.AnonymousNewsletterSubscriber' to type 'Blackbaud.Web.Content.Core.Data.ShelbyConstituent'.
   at Blackbaud.Web.Content.Core.EmailJob.PopulateRecipient2(IDataProvider oRecipient, String sKey, String sSourceKey, Int32 constituentId)
   at Blackbaud.Web.Content.Core.EmailJob.PopulateNeedsDataPageOfRecipients(Int32[] iIDs, String sDataSourceKey)
   at Blackbaud.Web.Content.Core.EmailJob.ProcessNeedsDataDataSource(ArrayList IDs, String sDataSourceKey)
   at Blackbaud.Web.Content.Core.EmailJob.ProcessNeedsDataDataSources()
   at Blackbaud.Web.Content.Core.EmailJob.PopulateNeedsData()
   at Blackbaud.Web.Content.Core.EmailJob.ProcessAddressees()
   at Blackbaud.Web.Content.Core.EmailJob.DoProcessMailBlast()
   at Blackbaud.Web.Content.Core.EmailJob.ProcessMailBlast()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.LegacyListProcessorWrapper.PrepareForProcessing()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.LegacyDataProcessor.BuildRecipientsSelectionSQL()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.EmailProcessor.ProcessEmail()
   at Blackbaud.AppFx.ContentManagement.Platform.Email.Catalog.ProcessCMSEmailBusinessProcess.StartBusinessProcess()


 
This may occur when sending to a data source of None and using multiple list types. It may also occur for Newsletters.

This issue was resolved in the latest version of Blackbaud NetCommunity

Environment

 Blackbaud NetCommunity
 7.1.167.0

Was this article helpful?


Thanks for your feedback! Did this solve your issue?

Comments (optional):


Thanks for your feedback!
We're glad it was helpful but sorry it didn’t solve your issue. If you need assistance, click Chat with Support below.
We’re sorry to hear that. Please tell us why.

 I don't like how this works.

 The answer is confusing.

 The answer didn't match what I was searching for.

Additional Comments (optional):


Thanks for your feedback! If you need assistance, click Chat with Support below.
Thanks for your feedback. Help us make our products even better by sharing details in our Idea Banks or our online Community.
Thanks for letting us know. We'll work on clarifying the information in the article. If you need assistance, click Chat with Support below.
Thanks for letting us know. We'll work on updating the search engine to return more relevant results.