locked
When I move my program into another folder it runs an old version of the file RRS feed

  • Question

  • I'm running into a very annoying and strange problem. I'm compiling my program into bin\Debug. When I execute the .exe from there, it runs the latest version without issues. However, if I move that same application into any other folder of my computer, executing it runs an old version.

    How do I solve this? I've cleaned/rebuilt the project and restarted visual studio 2010 multiple times. If I upload the file to a website and download it from another computer it also executes the old version, so I'm very lost.

    Saturday, July 11, 2020 1:27 PM

Answers

  • Thank you. I figured out what it was: it seems I accidentally changed the Language parameter of the form, so whenever I moved it out of the bin directory it executed the version prior to that change.
    • Marked as answer by WeekSky Saturday, July 11, 2020 3:18 PM
    Saturday, July 11, 2020 3:18 PM

All replies

  • Try the following

    1. Open Windows Explorer to the project folder.
    2. Delete the obj and bin folders
    3. Go back to Visual Studio
    4. Perform a rebuild on the Visual Studio solution.
    5. Run the project, if it runs properly copy the bin folder to another location and run it.

    Did the above resolve the issue or not? If it did this means the build process was confused and removal of the obj folder clear things up.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Saturday, July 11, 2020 2:00 PM
  • After doing this, moving the bin folder to another location makes the project run the latest version, but if I only move the .exe it still runs an old one.
    Saturday, July 11, 2020 2:04 PM
  • After doing this, moving the bin folder to another location makes the project run the latest version, but if I only move the .exe it still runs an old one.

    Here is how things work, when you build a project Visual Studio build using these setting from configuration manager (right click on solution explorer top node.

    Then from this a build process checks to see (when performing a rebuild, not a build/run) if anything has been updated code wise againsts assertions using files in the obj folder. If no changes we get the same as the last build and if not the build executes and a new .exe is created along with any dependency projects e.g. class projects if they are needed.

    So with that said if you do a rebuild and get the old executable there is something else going on outside the steps mentioned above. What else is going on, unsure, been using visual studio since version 1 and have only seen this happen when setting in configuration manager don't match what I presented.

    Last thing to try outside the above, create a new visual studio solution, create a new project, delete the default form, add items from the other project into this new project and see what happens. Make sure not to simply copy the project to a new location as this defeats seeing what the problem may be.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Saturday, July 11, 2020 2:39 PM
  • Thank you. I figured out what it was: it seems I accidentally changed the Language parameter of the form, so whenever I moved it out of the bin directory it executed the version prior to that change.
    • Marked as answer by WeekSky Saturday, July 11, 2020 3:18 PM
    Saturday, July 11, 2020 3:18 PM