Check ASPX files to make sure that Resource Key referenced exsists in RESX Check ASPX files to make sure that Resource Key referenced exsists in RESX asp.net asp.net

Check ASPX files to make sure that Resource Key referenced exsists in RESX


I was curious if this was possible as well, and could not find any useful information about this either. I made a proof of concept application which basically does 3 things

  1. Go through the files in the subdirectory you select, and find the ascx and aspx files in it.

  2. Search the files after the various possibilities for a resource string in them, parsing meta:resourcekey= and <%$ Resources: and flag them for being explicit or implicit depending on the key having a class or not. (Resources: tags only) and storing the local or global resx name.

  3. Search through the specified local and global resourcepath depending on which type of resource it is, and search the found resx files with a ResXResourceReader, and add any missing keys from the parsed aspx/ascx files, to be viewed in a gridview.

It does not yet handle different languages, but that should be fairly easy to add. I'm sure i'm missing a number of other things, since we normally use xml files or database for our projects resources, but it is usable and if it doesn't suit your specific needs, simply modify the source which you can find here