I've observed something happening in VS.NET using C# and would like to
know whether this is a bug or not. Recreating it is simple:

1. Create a Class Library project.
2. The Class Library should contain the following:

using System;

namespace TestDebugging {
        public class SomeClass {
                public static int Method1() {
                        int i=10;
                        return i;
                }
        }
}

3. Compile the Class Library.

4. Create a ConsoleApplication.
5. Add a reference within the console app to
the Class Library above, with Copy Local set to True.
6. The console app should contain the following:

using System;

namespace TestDebugging {
        class ConsumerClass {
                static void Main(string[] args) {
                        int i = SomeClass.Method1();
                        Console.WriteLine( i.ToString() );
                        Console.Read();
                }
        }
}

7. Compile the console app.
8. Put a breakpoint within the Method1() method in
the class library, set the class library's Debug Mode
to Program, and set the Start Application to the console
app above.
9. Hit F5 - everything works as expected.
10. Now the good part - make a change to the Class Library by
altering the integer
returned in Method1() - say i=99. Recompile the Class Library
ONLY.
11. Hit F5 again - VS.NET steps into the class library, and runs
the line i=99. However, the Console reads the old number, 10.

Comments please.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to