Sarang Amrutkar
Sarang Amrutkar

Reputation: 883

Delete unused files / images from asp.net project

My question is somewhat different. Currently I am working on asp.net web project in which I have many images and html pages, out of which i am using very few. Now want to delete unused out of them but need to check every aspx/htm/master page whether i used them or not. So is there any way i come to know that which files are unused ? Is there any tool for it ? or any thing i come to know while build/compile project ? Thanks in advance.

Upvotes: 2

Views: 1931

Answers (1)

Pit Digger
Pit Digger

Reputation: 9800

Check this opensource prject https://github.com/jitbit/vs-unused-image-finder

http://minhdanh2002.blogspot.com/2010/05/identifying-used-and-unused-resources.html

Basically you have to parse your aspx code and get list of asp image tags or img tags . Get src attribute or imageurl attribute and than put it in a list to get all used images . Get directory list of image on your website and check if its used against list from page images . Although images might be referenced via real or absolute path so you have to take that in consideration .

Upvotes: 2

Related Questions