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. PropertyInfo.GetValue()------------------ Reflection

PropertyInfo.GetValue()------------------ Reflection

Scheduled Pinned Locked Moved C#
9 Posts 9 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.
  • A Offline
    A Offline
    arun_pk
    wrote on last edited by
    #1

    i am trying to use PropertyInfo.GetValue() method to get the property value of some class.. its throuwing some target not found exception... pls advise me the correct way..

    S L _ P R 6 Replies Last reply
    0
    • A arun_pk

      i am trying to use PropertyInfo.GetValue() method to get the property value of some class.. its throuwing some target not found exception... pls advise me the correct way..

      S Offline
      S Offline
      sanforjackass
      wrote on last edited by
      #2

      inlight me!!

      EASY COME EASY GO

      1 Reply Last reply
      0
      • A arun_pk

        i am trying to use PropertyInfo.GetValue() method to get the property value of some class.. its throuwing some target not found exception... pls advise me the correct way..

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        arun_pk wrote:

        its throuwing some target not found exception..

        Can you show the code where it is throwing that exception?

        I are Troll :suss:

        1 Reply Last reply
        0
        • A arun_pk

          i am trying to use PropertyInfo.GetValue() method to get the property value of some class.. its throuwing some target not found exception... pls advise me the correct way..

          _ Offline
          _ Offline
          _Erik_
          wrote on last edited by
          #4

          This exception can be thrown in two cases: - The property is not static and you pass null to the target parameter. - The property is not static but the object you pass as target does not match the target type. As you say you want to "get the property value of some class" I guess your case is the first one. If a property is not static, you can get the property value of an instance of a class.

          1 Reply Last reply
          0
          • A arun_pk

            i am trying to use PropertyInfo.GetValue() method to get the property value of some class.. its throuwing some target not found exception... pls advise me the correct way..

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            Show your code.

            1 Reply Last reply
            0
            • A arun_pk

              i am trying to use PropertyInfo.GetValue() method to get the property value of some class.. its throuwing some target not found exception... pls advise me the correct way..

              R Offline
              R Offline
              RaviRanjanKr
              wrote on last edited by
              #6

              To better clarification you need to show code. :)

              1 Reply Last reply
              0
              • A arun_pk

                i am trying to use PropertyInfo.GetValue() method to get the property value of some class.. its throuwing some target not found exception... pls advise me the correct way..

                A Offline
                A Offline
                Abhinav S
                wrote on last edited by
                #7

                Some of[^] the errors that reflection can throw while using GetValue(). Its impossible for anyone to help you until you post some code here.

                The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

                S 1 Reply Last reply
                0
                • A Abhinav S

                  Some of[^] the errors that reflection can throw while using GetValue(). Its impossible for anyone to help you until you post some code here.

                  The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

                  S Offline
                  S Offline
                  samjog_c
                  wrote on last edited by
                  #8

                  I was doing assigng some wron object inside GetValue() PropertyInfo.GetValue(classobj,null) classobj should be the object of the class which we want to get property thanks ...

                  B 1 Reply Last reply
                  0
                  • S samjog_c

                    I was doing assigng some wron object inside GetValue() PropertyInfo.GetValue(classobj,null) classobj should be the object of the class which we want to get property thanks ...

                    B Offline
                    B Offline
                    Bernhard Hiller
                    wrote on last edited by
                    #9

                    Ehm... Does that mean that samjog_c and arun_pk are actually the same user?

                    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