I have a rather large website 开发者_运维知识库that had its strings externalized. I wanted to know if there was a way to check to make sure that a resource object in the ASPX exists in the resource file that is being referenced? There are a few pages that get parser errors, but I want to be able to batch check all the files.
If there is a tool or some way to check all the files and you know how I would greatly appreciate if you would be able to assist me in this.
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
Go through the files in the subdirectory you select, and find the ascx and aspx files in it.
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.
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
精彩评论