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. Could not evaluate expression

Could not evaluate expression

Scheduled Pinned Locked Moved C#
helpcsharpc++csscom
30 Posts 5 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.
  • D Dave Kreskowiak

    Are all thes eprojects in the same solution or are they seperate solutions?? Is everything compiled Debug?? Are you referencing the .DLL's in the other projects directly or are you referencing the projects themselves??

    A guide to posting questions on CodeProject[^]
    Dave Kreskowiak

    M Offline
    M Offline
    MichCl
    wrote on last edited by
    #15

    Thank you for the suggestions. The projects are separate solutions. They are all compiled debug, according to Build->Configuration Manager->Configuration . I reference the .dll's in the other projects directly (Solution Explorer->References->Browse to the .dll of the other project). It's possible that I am implementing a more C++-centric solution and that there is a more c# way that would make the project more stable, and I'd be open to that idea. It could also be that there's another setting somewhere in the project that got messed up...

    1 Reply Last reply
    0
    • J Jibesh

      what is

      edfed = new Sec();

      this Sec class do here? have you tried to put a break point in Sec class constructor and see whether it hits or not

      Jibesh V P

      M Offline
      M Offline
      MichCl
      wrote on last edited by
      #16

      Jibesh, I can't put a breakpoint in Sec because I can't step into the class that instantiates it.

      1 Reply Last reply
      0
      • P Pete OHanlon

        When you reference the assemblies in your project, if they are in the same solution, it's a great idea to make sure that you have added them as project references, rather than browsing to the DLLs and selecting those. One thing I would check - do a clean on your solution (make sure you actually remove the bin directories as well), and then do a full rebuild - look to see if the pdb file for the cr5 assembly has been copied into the bin directory of the executing process.

        I was brought up to respect my elders. I don't respect many people nowadays.
        CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

        M Offline
        M Offline
        MichCl
        wrote on last edited by
        #17

        When you say it's better to add them as project references, could you clarify this? You're not talking about going to Solution Explorer->References->Browse to other solution dll?

        D 1 Reply Last reply
        0
        • J Jibesh

          what is

          edfed = new Sec();

          this Sec class do here? have you tried to put a break point in Sec class constructor and see whether it hits or not

          Jibesh V P

          M Offline
          M Offline
          MichCl
          wrote on last edited by
          #18

          Thanks Jibesh. The code you reference above is in the constructor of cr5 and edfed is the variable name and Sec is the class. In this example, I also have

          Sec edfed = null;

          in the variable declaration section above the constructor. I have also tried putting the whole thing above the constructor as a class variable:

          Sec edfed = new Sec();

          But I still see "could not evaluate expression" for edfed in cr5 class.

          L 1 Reply Last reply
          0
          • M MichCl

            When you say it's better to add them as project references, could you clarify this? You're not talking about going to Solution Explorer->References->Browse to other solution dll?

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #19

            In the References dialog you can pick what you want to set a reference to. That includes Browsing to a .DLL, a registered .NET assembly, or another project. The thing is that project needs to be part of the solution you're currently in. It would be better for you if you added these other .DLL projects to a single solution.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            M 1 Reply Last reply
            0
            • M MichCl

              Thanks Jibesh. The code you reference above is in the constructor of cr5 and edfed is the variable name and Sec is the class. In this example, I also have

              Sec edfed = null;

              in the variable declaration section above the constructor. I have also tried putting the whole thing above the constructor as a class variable:

              Sec edfed = new Sec();

              But I still see "could not evaluate expression" for edfed in cr5 class.

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

              I'll throw you a bone... I've copied code into a C# program that introduced unprintable characters that wound up generating bizarre compiler errors. Delete the offending code and re-type it. P.S. I find your obfusticating of code snippets ... obfusticating (it's all been done before) ... unless you're worried about your "boss" seeing what you're posting.

              M 2 Replies Last reply
              0
              • L Lost User

                I'll throw you a bone... I've copied code into a C# program that introduced unprintable characters that wound up generating bizarre compiler errors. Delete the offending code and re-type it. P.S. I find your obfusticating of code snippets ... obfusticating (it's all been done before) ... unless you're worried about your "boss" seeing what you're posting.

                M Offline
                M Offline
                MichCl
                wrote on last edited by
                #21

                Deleting and re-typing is a good idea. Thanks anyway.

                1 Reply Last reply
                0
                • P Pete OHanlon

                  When you reference the assemblies in your project, if they are in the same solution, it's a great idea to make sure that you have added them as project references, rather than browsing to the DLLs and selecting those. One thing I would check - do a clean on your solution (make sure you actually remove the bin directories as well), and then do a full rebuild - look to see if the pdb file for the cr5 assembly has been copied into the bin directory of the executing process.

                  I was brought up to respect my elders. I don't respect many people nowadays.
                  CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                  M Offline
                  M Offline
                  MichCl
                  wrote on last edited by
                  #22

                  That was the best idea all day. I did a clean build in all of the projects/solutions and had a compiler error where it was complaining about a deleted method. I found an old exe file in my main program debug directory. It's date didn't match the dll and pdb files associated with it (this was for the cr5 class). Every time I cleaned and rebuilt it was re-copied into the directory. Finally, I added the class as a reference in my main program and another program, and it went away. I didn't think I would need to add cr5 as a reference in a class that wasn't using it, but the other solutions were called in the program (and putting the cr5 build files in it's directory), so I guess it needed it. Thanks!!!!

                  P 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    In the References dialog you can pick what you want to set a reference to. That includes Browsing to a .DLL, a registered .NET assembly, or another project. The thing is that project needs to be part of the solution you're currently in. It would be better for you if you added these other .DLL projects to a single solution.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak

                    M Offline
                    M Offline
                    MichCl
                    wrote on last edited by
                    #23

                    You have been very helpful. Thank you so much for all of your help. Is there a way I can give you "credit" on this site for your help? I know on other sites I've voted people "up", but I'm not seeing that here.

                    P D 2 Replies Last reply
                    0
                    • M MichCl

                      That was the best idea all day. I did a clean build in all of the projects/solutions and had a compiler error where it was complaining about a deleted method. I found an old exe file in my main program debug directory. It's date didn't match the dll and pdb files associated with it (this was for the cr5 class). Every time I cleaned and rebuilt it was re-copied into the directory. Finally, I added the class as a reference in my main program and another program, and it went away. I didn't think I would need to add cr5 as a reference in a class that wasn't using it, but the other solutions were called in the program (and putting the cr5 build files in it's directory), so I guess it needed it. Thanks!!!!

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #24

                      I'm glad you got there in the end. Good job.

                      I was brought up to respect my elders. I don't respect many people nowadays.
                      CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                      M 2 Replies Last reply
                      0
                      • P Pete OHanlon

                        I'm glad you got there in the end. Good job.

                        I was brought up to respect my elders. I don't respect many people nowadays.
                        CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                        M Offline
                        M Offline
                        MichCl
                        wrote on last edited by
                        #25

                        Thanks for all your help too! You are very helpful. I'm so glad I got past that and can debug my project now!!!! I'm definitely going to be having a meeting with people to see if I should pull some of the other solutions into the same project.

                        1 Reply Last reply
                        0
                        • L Lost User

                          I'll throw you a bone... I've copied code into a C# program that introduced unprintable characters that wound up generating bizarre compiler errors. Delete the offending code and re-type it. P.S. I find your obfusticating of code snippets ... obfusticating (it's all been done before) ... unless you're worried about your "boss" seeing what you're posting.

                          M Offline
                          M Offline
                          MichCl
                          wrote on last edited by
                          #26

                          BTW, my boss is quite aware that I ask questions on websites and approves of the changes I make. He knows that we have a very small user's group and I'm the only programmer (and there's only one other c# programmer), so understands when I need to ask other people's opinion. I'm sorry if the snippets don't encompass the entire project, but I've had people complain about the opposite. They complain when I show too much code and info. Luckily, I figured it out, and I'm all set.

                          1 Reply Last reply
                          0
                          • M MichCl

                            You have been very helpful. Thank you so much for all of your help. Is there a way I can give you "credit" on this site for your help? I know on other sites I've voted people "up", but I'm not seeing that here.

                            P Offline
                            P Offline
                            Pete OHanlon
                            wrote on last edited by
                            #27

                            When you have a message open, there's a green and red arrow at the left hand side of it. Click the green to vote up and the red to down vote.

                            I was brought up to respect my elders. I don't respect many people nowadays.
                            CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                            1 Reply Last reply
                            0
                            • M MichCl

                              You have been very helpful. Thank you so much for all of your help. Is there a way I can give you "credit" on this site for your help? I know on other sites I've voted people "up", but I'm not seeing that here.

                              D Offline
                              D Offline
                              Dave Kreskowiak
                              wrote on last edited by
                              #28

                              Pete beat me to answering, but you're welcome!

                              A guide to posting questions on CodeProject[^]
                              Dave Kreskowiak

                              1 Reply Last reply
                              0
                              • P Pete OHanlon

                                I'm glad you got there in the end. Good job.

                                I was brought up to respect my elders. I don't respect many people nowadays.
                                CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                                M Offline
                                M Offline
                                MichCl
                                wrote on last edited by
                                #29

                                Do you have any thoughts on why this question isn't appearing in my question list?

                                P 1 Reply Last reply
                                0
                                • M MichCl

                                  Do you have any thoughts on why this question isn't appearing in my question list?

                                  P Offline
                                  P Offline
                                  Pete OHanlon
                                  wrote on last edited by
                                  #30

                                  Look in messages, not Q&A Questions. It's in there.

                                  I was brought up to respect my elders. I don't respect many people nowadays.
                                  CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                                  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