Deleting image - Exception has been thrown by ther target of

Posted by Community Admin on 04-Aug-2018 09:41

Deleting image - Exception has been thrown by ther target of an invocation

All Replies

Posted by Community Admin on 17-Aug-2012 00:00

I have a 5.1 sp1 installattion When I try to delete an image from an library I get the attached error. Anyone with an idea?


Posted by Community Admin on 22-Aug-2012 00:00


I did find out that it seems the problem is related to tags. 

I deleted all images from a library by selecting them and deleting them. Some could be deleted and some threw the exeption.

I could delete all but those with two certain tags given. I tried to delete the tags but would get the same exception.

I can change the tag but not delete them.

Any idea why deletint a tag could couse this error?


Posted by Community Admin on 22-Aug-2012 00:00

@ Telerik

I can unpublish images that throw the exception when I try to delete them. However, when I try to publish them again I get the same exception again.

See here


Posted by Community Admin on 27-Aug-2012 00:00

Hi Markus,

The problem looks similar to an issue we've been trying to reproduce locally, but without any luck.

Would you mind running the below script on your database, and let us know if the problems persist?

The problem we have in mind relates to miscalculated taxonomy statistics, where duplicate statistic entries exist for the same content type and taxonID. The script uopdates the records in the database, removing any duplicate entries and combining them into one statistic with the correct number of marked items.

declare @T table(
      taxon_id uniqueidentifier,
      statistic_type int,
      data_item_type varchar(255),
      item_provider_name varchar(255),
      marked_count bigint,
      id uniqueidentifier,
      duplicated_count int
insert into @T
      ,sum(marked_items_count) as marked_count
FROM [sf_taxonomy_statistic]
group by taxon_id, data_item_type, statistic_type, item_provider_name
having count(taxon_id) > 1
select count(*) from @T
delete [sf_taxonomy_statistic]
      [sf_taxonomy_statistic] as stat
inner join 
      @T as temp
      stat.taxon_id = temp.taxon_id
      and stat.data_item_type = temp.data_item_type
      and stat.statistic_type = temp.statistic_type
      and stat.item_provider_name = temp.item_provider_name
      and <>
update stat
      marked_items_count = temp.marked_count
      [sf_taxonomy_statistic] stat
inner join 
      @T as temp
on =

Looking forwards to your reply.

Boyan Barnev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 27-Aug-2012 00:00

Dear Boyan

I did run the script on the DB and was afterwards able to delete the tags and therefor the library with the images. 

Don't know how I got to that point so not much help in telling you how to reproduce it. But you solved the case .


Posted by Community Admin on 05-Nov-2012 00:00

Any chance this is fixed in 5.2? I had this exception after I made a blog post with tags and categories and got this exception. Why does this happen after just adding a couple tags and categories?

Posted by Community Admin on 07-Nov-2012 00:00

Using this SQL also worked for me. I was having this problem in the event module. Trying to edit or delete a specifc event would result in this message. I duplicated the event (be viewing it and copying the details) and noted that the addition of a specific Tag resulted in the event not saving (and displaying the error message). Running the script and forcing the Events module page to refresh fixed it.

I can supplied a log of the .net error by email (cannot attach zips or text to this reply)


This thread is closed