Hi all,

i made some modifications to my code which i wrote previoustly.
But when i run it, the previous code is executing.
i showed a msgbox inside button click.Next day i erased & it wrote
a different code. when i click it still the msgbox is being appeared.

PLZ help me solve this.

Edited 5 Years Ago by coroll: n/a

If your using Visual Studio, have you tried Rebuild Solution in the Build menu? It is possible that the IDE thinks the executable is newer than the source code. I know when building VC++ in Visual Studio, it gives you the option to run the previous successful build, if there are compile errors. I don't know if C# has the same option.

It's hard to tell without more details (i.e. IDE, source code, etc.).

I know when building VC++ in Visual Studio, it gives you the option to run the previous successful build, if there are compile errors.

Yes, this caused me much confusion when I started with VS until I turned it off.
It is found in Tools - Options - Projects and Solutions - Build and Run -
On Run, when build or deployment errors occur:
I have mine set to Do not launch to prevent just this kind of confusion.

I also have Before building set to Save all changes to make sure my newest changes are all compiled
(Note: Undo info is not lost if the file is left open.)

Using VS 2010 pro. With my installation, the option to Save all changes was set by default.

Edited 5 Years Ago by ddanbe: n/a

If your using Visual Studio, have you tried Rebuild Solution in the Build menu? It is possible that the IDE thinks the executable is newer than the source code. I know when building VC++ in Visual Studio, it gives you the option to run the previous successful build, if there are compile errors. I don't know if C# has the same option.

It's hard to tell without more details (i.e. IDE, source code, etc.).

yes if thee are errors it asks to run previous version.no i didnt try to rebuild.Mine
is 2008 and it is a trial version.

So... I'm assuming you have tried to rebuild it, and it didn't work?

You could also try deleting the executable in the bin\Debug (or Release) folder. If the executable's gone, there shouldn't be any reason it would execute old code. You may also have to delete the executable in the obj\x86\Debug folder.

This question has already been answered. Start a new discussion instead.