none
Visual Studio runs code that I wrote earlier rather than running the current code. RRS feed

  • Question

  • I am working on a console application in visual studio c# I wrote a code and executed that code but than I changed the code and changed it completely There is no similarity between the earlier code and the current code written but when I run the program it executes the code I wrote earlier although I changed the code saved it. I don't know what to do ?
    Sunday, March 18, 2018 2:38 PM

All replies

  • Have you built the solution before executing the application? And where are you executing it from. Are you debugging the application, or you start the .exe from the debug or release folder on the folder that holds the application? Try to rebuild the application before running it and it should fix the issue.
    Sunday, March 18, 2018 2:59 PM
  • Try Cleaning the project and re build the solution. Also please remove the "Bin" folder and build it again. 
    Sunday, March 18, 2018 4:00 PM
  • Are you sure there is no error given, because then this is normal behaviour.

    Success
    Cor

    Sunday, March 18, 2018 4:44 PM
  • Two things to check

    • Right click the solution name (top node) in solution explorer.
    • Select "Configuration Manager"
    • Once the dialog appears, look to see if the Build column is checked for the project.

    Have the Output window open when building the project.

    • From the IDE menu: View -> Other Windows -> Output
    • When building is complete see if the build was successful  

    Example, in my solution I have nine projects. If succeeded is 0 then there is an issue with the build or refer to the first thought above.

    Other than that, close the project, in Windows Explorer remove the Bin and Obj folders for the project. Open the project and do a build, did it build?


    Please remember to mark the replies as answers if they help and unmark 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.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, March 18, 2018 11:01 PM
    Moderator