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.
  • M MichCl

    I've been looking at a problem for the last couple of days, that hopefully someone has an answer for. When I get my variable (cr) as shown below, I can't use the variable and then step into the next method call and code that once worked is now not working. When I look into the class definition inside cr, it says "could not evaluate expression" edfed for the variable inside the class (cr). I've searched the internet and found a couple of sources that seem to be saying that I have something that's null, but I'm not seeing why edfed would be null here. http://stackoverflow.com/questions/9558498/could-not-evaluate-expression-activator-createinstancet[^] This is where I obtain my class definition of cr:

    cr = factory.GetCR(type);

    I can show you the factory GetCR method, but I don't think there's an issue there:

    public iCR GetCR(CRType type)
    {
    iCR cr = null;
    switch (type)
    {
    case CRType.CR5:
    cr = new CR5_new.CR5();
    break;
    }
    }

    In my CR5 class, this is how I define edfed. (It's possible that I could do something more in a C# way here and less of a C++ way like I'm familiar with; feel free to make suggestions):

    using Sec_;

    namespace CR5_new
    {
    public class CR5:iCR
    {
    Sec edfed = null;

       //constructor
        public CR5()
        {
            edfed = new Sec();
            System.Diagnostics.Debug.WriteLine("edfed definition: " + edfed); //this print statement doesn't show up. Not sure why
        }
    

    ...

    I also tried defining edfed in CR5 as follows and get the same result:

    using Sec_;

    namespace CR5_new
    {
    public class CR5:iCR
    {
    Sec edfed = new Sec(); //the difference

       //constructor
        public CR5()
        {
            System.Diagnostics.Debug.WriteLine("edfed definition: " + edfed); //this print statement doesn't show up. Not sure why
        }
    

    ...

    I'm hoping someone has a good suggestion of what I could do to fix this. It's really stumping us. Thanks.

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

    cr = factory.GetCR(type);

    This looks to be the likeliest culprit. The question I'd have here is what is the value of type? In your switch statement, it only retrieves this value if it's CRType.CR5. If it's not that type, then it doesn't look like you're returning anything.

    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

    D M 2 Replies Last reply
    0
    • M MichCl

      I've been looking at a problem for the last couple of days, that hopefully someone has an answer for. When I get my variable (cr) as shown below, I can't use the variable and then step into the next method call and code that once worked is now not working. When I look into the class definition inside cr, it says "could not evaluate expression" edfed for the variable inside the class (cr). I've searched the internet and found a couple of sources that seem to be saying that I have something that's null, but I'm not seeing why edfed would be null here. http://stackoverflow.com/questions/9558498/could-not-evaluate-expression-activator-createinstancet[^] This is where I obtain my class definition of cr:

      cr = factory.GetCR(type);

      I can show you the factory GetCR method, but I don't think there's an issue there:

      public iCR GetCR(CRType type)
      {
      iCR cr = null;
      switch (type)
      {
      case CRType.CR5:
      cr = new CR5_new.CR5();
      break;
      }
      }

      In my CR5 class, this is how I define edfed. (It's possible that I could do something more in a C# way here and less of a C++ way like I'm familiar with; feel free to make suggestions):

      using Sec_;

      namespace CR5_new
      {
      public class CR5:iCR
      {
      Sec edfed = null;

         //constructor
          public CR5()
          {
              edfed = new Sec();
              System.Diagnostics.Debug.WriteLine("edfed definition: " + edfed); //this print statement doesn't show up. Not sure why
          }
      

      ...

      I also tried defining edfed in CR5 as follows and get the same result:

      using Sec_;

      namespace CR5_new
      {
      public class CR5:iCR
      {
      Sec edfed = new Sec(); //the difference

         //constructor
          public CR5()
          {
              System.Diagnostics.Debug.WriteLine("edfed definition: " + edfed); //this print statement doesn't show up. Not sure why
          }
      

      ...

      I'm hoping someone has a good suggestion of what I could do to fix this. It's really stumping us. Thanks.

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

      Your using terminology that doesn't mean what you think it does, so your post is a bit confusing. For example, "This is where I obtain my class definition". "class definition" is the actual Class myClassName block, not creating an instance of a class, which is normally refered to as an "Object". If these snippets are not edited to remove what you think is irrelevent code to this problem, it's amazing this code ever worked at all. Your GetCR method (terrible name by the way), shows that it should be returning either an object of type iCR or one that implements a possible iCR interface. There isn't enough codce snippet to be sure either way. But the method has no return statement in it, so it's always returning null. Also, what is the value of type that you're passing in?? Is it really CRType.CR5?? If you're wrong, the method will, again, return null. Oh! When asking questions about your own code, a copy'n'paste or the error message as well as the stack trace would be very helpful. As of right now, it's impossible to know for sure what your problem is as there is insufficient detail. So, put a breakpoint on the line that throws the error and run your app. When the code stops, hit F11 to step into the next line of code and watch the execution and explore the contents of variables to see if the code is really doing what you think it should be doing. Chances are really good it'll show YOU that you're making incorrect assumptions about the execution of your own code. Instead of guessing at what the problem might be, you better prove to yourself that it is indeed the problem by stepping through the code as outlined above. Oh, and learn to read the stack trace! These are critical skills you must have in order to write code.

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

      M 1 Reply Last reply
      0
      • P Pete OHanlon

        cr = factory.GetCR(type);

        This looks to be the likeliest culprit. The question I'd have here is what is the value of type? In your switch statement, it only retrieves this value if it's CRType.CR5. If it's not that type, then it doesn't look like you're returning anything.

        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

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

        On top of that, there is no

        return

        statement in that method either, so no matter what happens in that method it's returning null.

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

        1 Reply Last reply
        0
        • P Pete OHanlon

          cr = factory.GetCR(type);

          This looks to be the likeliest culprit. The question I'd have here is what is the value of type? In your switch statement, it only retrieves this value if it's CRType.CR5. If it's not that type, then it doesn't look like you're returning anything.

          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
          #5

          Thanks for the idea, but I don't think that's it. The rest of the factory method/case statement looks like this:

          default:
          throw new ArgumentException(string.Format("A CR of type {0} cannot be found", Enum.GetName(typeof(CRType), type)));
          }
          return cr;

          It also couldn't be that because the rest of the variables associated with the cr variable returned from the factory look good when I mouse over and expand it when I run the program. It's just the edfed one that's an issue. No exception is thrown in the remainder of the case statement above, so it's not getting to the default. Any other ideas??

          P 1 Reply Last reply
          0
          • M MichCl

            Thanks for the idea, but I don't think that's it. The rest of the factory method/case statement looks like this:

            default:
            throw new ArgumentException(string.Format("A CR of type {0} cannot be found", Enum.GetName(typeof(CRType), type)));
            }
            return cr;

            It also couldn't be that because the rest of the variables associated with the cr variable returned from the factory look good when I mouse over and expand it when I run the program. It's just the edfed one that's an issue. No exception is thrown in the remainder of the case statement above, so it's not getting to the default. Any other ideas??

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

            Put a break point in the constructor of the class you're trying to instantiate and see if it gets hit. Similarly, put a break point in before the factory method. As you've shown us incomplete fragments, we can only guess, and I suspect that your problem lies elsewhere.

            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 1 Reply Last reply
            0
            • D Dave Kreskowiak

              Your using terminology that doesn't mean what you think it does, so your post is a bit confusing. For example, "This is where I obtain my class definition". "class definition" is the actual Class myClassName block, not creating an instance of a class, which is normally refered to as an "Object". If these snippets are not edited to remove what you think is irrelevent code to this problem, it's amazing this code ever worked at all. Your GetCR method (terrible name by the way), shows that it should be returning either an object of type iCR or one that implements a possible iCR interface. There isn't enough codce snippet to be sure either way. But the method has no return statement in it, so it's always returning null. Also, what is the value of type that you're passing in?? Is it really CRType.CR5?? If you're wrong, the method will, again, return null. Oh! When asking questions about your own code, a copy'n'paste or the error message as well as the stack trace would be very helpful. As of right now, it's impossible to know for sure what your problem is as there is insufficient detail. So, put a breakpoint on the line that throws the error and run your app. When the code stops, hit F11 to step into the next line of code and watch the execution and explore the contents of variables to see if the code is really doing what you think it should be doing. Chances are really good it'll show YOU that you're making incorrect assumptions about the execution of your own code. Instead of guessing at what the problem might be, you better prove to yourself that it is indeed the problem by stepping through the code as outlined above. Oh, and learn to read the stack trace! These are critical skills you must have in order to write code.

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

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

              Dave, thanks for the thoughts. I'm sorry my code is confusing to you. The class names have been shortened because I don't want to give away secure info. All code snippets are edited to remove code that isn't relevant. See my reply to the other response to this question for the rest of the factory method that shows what the default is if it doesn't fall into a case. Unfortunately, as I said, I can't step into the code that has the error message for some reason, and can only see it by exploring (with + for the cr class) during execution of the code (after I obtain the cr from the factory), and it shows up that way. I posted the error message in the subject and also in my problem statement. I'll look into whether it has a stack trace. Good idea.

              L 1 Reply Last reply
              0
              • M MichCl

                I've been looking at a problem for the last couple of days, that hopefully someone has an answer for. When I get my variable (cr) as shown below, I can't use the variable and then step into the next method call and code that once worked is now not working. When I look into the class definition inside cr, it says "could not evaluate expression" edfed for the variable inside the class (cr). I've searched the internet and found a couple of sources that seem to be saying that I have something that's null, but I'm not seeing why edfed would be null here. http://stackoverflow.com/questions/9558498/could-not-evaluate-expression-activator-createinstancet[^] This is where I obtain my class definition of cr:

                cr = factory.GetCR(type);

                I can show you the factory GetCR method, but I don't think there's an issue there:

                public iCR GetCR(CRType type)
                {
                iCR cr = null;
                switch (type)
                {
                case CRType.CR5:
                cr = new CR5_new.CR5();
                break;
                }
                }

                In my CR5 class, this is how I define edfed. (It's possible that I could do something more in a C# way here and less of a C++ way like I'm familiar with; feel free to make suggestions):

                using Sec_;

                namespace CR5_new
                {
                public class CR5:iCR
                {
                Sec edfed = null;

                   //constructor
                    public CR5()
                    {
                        edfed = new Sec();
                        System.Diagnostics.Debug.WriteLine("edfed definition: " + edfed); //this print statement doesn't show up. Not sure why
                    }
                

                ...

                I also tried defining edfed in CR5 as follows and get the same result:

                using Sec_;

                namespace CR5_new
                {
                public class CR5:iCR
                {
                Sec edfed = new Sec(); //the difference

                   //constructor
                    public CR5()
                    {
                        System.Diagnostics.Debug.WriteLine("edfed definition: " + edfed); //this print statement doesn't show up. Not sure why
                    }
                

                ...

                I'm hoping someone has a good suggestion of what I could do to fix this. It's really stumping us. Thanks.

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

                Let me clarify: When I get cr back from the factory, during execution, I can hit the + to look inside cr, and the issue is with the class Sec, with variable name edfed. It shows the error message of "Could not evaluate expression" for edfed. However, I can not step into cr's methods, either once I get cr back from the factory, or in the constructor, which is obtained in the factory. In other classes that use Sec, everything looks good, so I think the problem isn't in Sec, it's in how I define or instantiate, or obtain the object for Sec in the cr object. Sorry for any confusion. In case anyone wants to see something I didn't show above, iCR is an interface defined as:

                public interface iCR
                {
                event ProgressChangeHandler2 ProgressChanged;
                event PB_MaxHandler2 SetPB_Maximum;
                event PB_LabelHandler2 SetPB_Label;
                Boolean CB_IO_Init(int slaveIndex);
                int WritePortReady();
                int WritePortBusy();
                void WritePortFailure();
                void WritePortSuccess();
                void initCRData(byte[] wBuffer, byte[] sBuffer, int SlaveIndex, USB_Comm.Cl cb, int crType);
                int ProcessTWriting(ref byte[] wDat, bool isFastMode);
                int ReadT(ref byte[] data);
                void Failure(String message);
                void Success(String message);
                }

                1 Reply Last reply
                0
                • P Pete OHanlon

                  Put a break point in the constructor of the class you're trying to instantiate and see if it gets hit. Similarly, put a break point in before the factory method. As you've shown us incomplete fragments, we can only guess, and I suspect that your problem lies elsewhere.

                  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
                  #9

                  When I try stepping into

                  crum = new CR5_new.CR5();

                  it (=>)goes to the break statement that comes after the line shown above and the output window is showing: Step into: Stepping over method without symbols 'CR5_new.CR5.CR5' Any idea why the constructor of CR5 wouldn't have symbols? It's built...

                  1 Reply Last reply
                  0
                  • M MichCl

                    Dave, thanks for the thoughts. I'm sorry my code is confusing to you. The class names have been shortened because I don't want to give away secure info. All code snippets are edited to remove code that isn't relevant. See my reply to the other response to this question for the rest of the factory method that shows what the default is if it doesn't fall into a case. Unfortunately, as I said, I can't step into the code that has the error message for some reason, and can only see it by exploring (with + for the cr class) during execution of the code (after I obtain the cr from the factory), and it shows up that way. I posted the error message in the subject and also in my problem statement. I'll look into whether it has a stack trace. Good idea.

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

                    MichCl wrote:

                    can't step into the code that has the error message for some reason, and can only see it by exploring (with + for the cr class) during execution of the code (after I obtain the cr from the factory), and it shows up that way.

                    Is it defined in the same project (as source), or does it come from another assembly that you linked to?

                    MichCl wrote:

                    I posted the error message in the subject

                    I get this one often, usually when I choose "Evaluate" in the IDE. It's not an exception, it's merely a message from the IDE that it cannot predict the outcome.

                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

                    M 1 Reply Last reply
                    0
                    • L Lost User

                      MichCl wrote:

                      can't step into the code that has the error message for some reason, and can only see it by exploring (with + for the cr class) during execution of the code (after I obtain the cr from the factory), and it shows up that way.

                      Is it defined in the same project (as source), or does it come from another assembly that you linked to?

                      MichCl wrote:

                      I posted the error message in the subject

                      I get this one often, usually when I choose "Evaluate" in the IDE. It's not an exception, it's merely a message from the IDE that it cannot predict the outcome.

                      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

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

                      cr5, icr, factory, sec, and the code that calls the factory get method are all separate dll's (compiled separately), but I own them (I own everything being run). Different projects. I used to be able to step into the cr5 code, and would expect to be able to step into the constructor/variable definition area, but for some reason it's not working. (message is step into: stepping over method without symbols 'cr5_new.cr5.cr5' shows in output window) I looked into this message, and found a couple of links: [^] http://stackoverflow.com/questions/1495720/stepping-over-method-without-symbols-how-to-step-into[^] I do have a pdb file for the cr5 build. I can't put a breakpoint in cr5 because the debugger is stepping over it and the implementation is in a separate project. It seems that you think the error message in the subject isn't my issue. If I could figure out how to step into my cr5 class, that would help me figure out what the issue is. Thanks!

                      D P 2 Replies Last reply
                      0
                      • M MichCl

                        cr5, icr, factory, sec, and the code that calls the factory get method are all separate dll's (compiled separately), but I own them (I own everything being run). Different projects. I used to be able to step into the cr5 code, and would expect to be able to step into the constructor/variable definition area, but for some reason it's not working. (message is step into: stepping over method without symbols 'cr5_new.cr5.cr5' shows in output window) I looked into this message, and found a couple of links: [^] http://stackoverflow.com/questions/1495720/stepping-over-method-without-symbols-how-to-step-into[^] I do have a pdb file for the cr5 build. I can't put a breakpoint in cr5 because the debugger is stepping over it and the implementation is in a separate project. It seems that you think the error message in the subject isn't my issue. If I could figure out how to step into my cr5 class, that would help me figure out what the issue is. Thanks!

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

                        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 1 Reply Last reply
                        0
                        • M MichCl

                          cr5, icr, factory, sec, and the code that calls the factory get method are all separate dll's (compiled separately), but I own them (I own everything being run). Different projects. I used to be able to step into the cr5 code, and would expect to be able to step into the constructor/variable definition area, but for some reason it's not working. (message is step into: stepping over method without symbols 'cr5_new.cr5.cr5' shows in output window) I looked into this message, and found a couple of links: [^] http://stackoverflow.com/questions/1495720/stepping-over-method-without-symbols-how-to-step-into[^] I do have a pdb file for the cr5 build. I can't put a breakpoint in cr5 because the debugger is stepping over it and the implementation is in a separate project. It seems that you think the error message in the subject isn't my issue. If I could figure out how to step into my cr5 class, that would help me figure out what the issue is. Thanks!

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

                          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 2 Replies Last reply
                          0
                          • M MichCl

                            I've been looking at a problem for the last couple of days, that hopefully someone has an answer for. When I get my variable (cr) as shown below, I can't use the variable and then step into the next method call and code that once worked is now not working. When I look into the class definition inside cr, it says "could not evaluate expression" edfed for the variable inside the class (cr). I've searched the internet and found a couple of sources that seem to be saying that I have something that's null, but I'm not seeing why edfed would be null here. http://stackoverflow.com/questions/9558498/could-not-evaluate-expression-activator-createinstancet[^] This is where I obtain my class definition of cr:

                            cr = factory.GetCR(type);

                            I can show you the factory GetCR method, but I don't think there's an issue there:

                            public iCR GetCR(CRType type)
                            {
                            iCR cr = null;
                            switch (type)
                            {
                            case CRType.CR5:
                            cr = new CR5_new.CR5();
                            break;
                            }
                            }

                            In my CR5 class, this is how I define edfed. (It's possible that I could do something more in a C# way here and less of a C++ way like I'm familiar with; feel free to make suggestions):

                            using Sec_;

                            namespace CR5_new
                            {
                            public class CR5:iCR
                            {
                            Sec edfed = null;

                               //constructor
                                public CR5()
                                {
                                    edfed = new Sec();
                                    System.Diagnostics.Debug.WriteLine("edfed definition: " + edfed); //this print statement doesn't show up. Not sure why
                                }
                            

                            ...

                            I also tried defining edfed in CR5 as follows and get the same result:

                            using Sec_;

                            namespace CR5_new
                            {
                            public class CR5:iCR
                            {
                            Sec edfed = new Sec(); //the difference

                               //constructor
                                public CR5()
                                {
                                    System.Diagnostics.Debug.WriteLine("edfed definition: " + edfed); //this print statement doesn't show up. Not sure why
                                }
                            

                            ...

                            I'm hoping someone has a good suggestion of what I could do to fix this. It's really stumping us. Thanks.

                            J Offline
                            J Offline
                            Jibesh
                            wrote on last edited by
                            #14

                            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 2 Replies Last reply
                            0
                            • 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
                                          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