Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. finding bad resource strings on compile

finding bad resource strings on compile

Scheduled Pinned Locked Moved C#
questionlearning
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    elena12345
    wrote on last edited by
    #1

    Hi, We have all strings that were not auto-generated stored in special resource files. I notticed that if the code refers to a non-existent resource string the compiler will not let you know about it, and you will find out things are not right until run time. Do you know of a way to make the compiler tell me about the resource problems? Thanks, Elena

    L H 2 Replies Last reply
    0
    • E elena12345

      Hi, We have all strings that were not auto-generated stored in special resource files. I notticed that if the code refers to a non-existent resource string the compiler will not let you know about it, and you will find out things are not right until run time. Do you know of a way to make the compiler tell me about the resource problems? Thanks, Elena

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      elena12345 wrote: Do you know of a way to make the compiler tell me about the resource problems? Code better :) leppie::AllocCPArticle("Zee blog");
      Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.

      E 1 Reply Last reply
      0
      • L leppie

        elena12345 wrote: Do you know of a way to make the compiler tell me about the resource problems? Code better :) leppie::AllocCPArticle("Zee blog");
        Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.

        E Offline
        E Offline
        elena12345
        wrote on last edited by
        #3

        Yeah, thanks a lot :laugh: I am just moving a bunch of code. And a bunch of resource strings have to move from one file to another. So I want to make sure I didn't leave anything out. Don't tell me to architect better. I didn't architect this thing ;P Elena

        K 1 Reply Last reply
        0
        • E elena12345

          Hi, We have all strings that were not auto-generated stored in special resource files. I notticed that if the code refers to a non-existent resource string the compiler will not let you know about it, and you will find out things are not right until run time. Do you know of a way to make the compiler tell me about the resource problems? Thanks, Elena

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          The compiler (csc.exe in this case) doesn't care about resource files, just like the resource compiler (resgen.exe) doesn't care about source code.

          Microsoft MVP, Visual C# My Articles

          1 Reply Last reply
          0
          • E elena12345

            Yeah, thanks a lot :laugh: I am just moving a bunch of code. And a bunch of resource strings have to move from one file to another. So I want to make sure I didn't leave anything out. Don't tell me to architect better. I didn't architect this thing ;P Elena

            K Offline
            K Offline
            Kentamanos
            wrote on last edited by
            #5

            You could have an external application use reflection on your assembly to check for completeness. You could do something like create string contants in a certain namespace and have this program use reflection on that namespace to get each string constant. It could then use reflection to make sure the resources contain something named the same thing. You could then make this "check" part of your build.


            I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
            -David St. Hubbins

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups