Results 1 to 5 of 5

Thread: [RESOLVED] Project running old code instead of new

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Posts
    241

    Resolved [RESOLVED] Project running old code instead of new

    I have a solution with a couple different projects. I have been working on them and adding to them for several months. Out of nowhere, one of the subs in my project is not recognizing updated code. I had a for loop in there that was acting funny so I changed something and noticed no difference. I messed with it for a while and decided to just replace everything in that sub with a simple msgbox and it still tries to run the code that was previously there. I have built the solution, rebuilt it, cleaned it, closed and reopened it, removed the bin and obj folders and restarted my computer several times. This is not a server program or anything dealing with IIS or anything like that. Any idea what's going on?

    **Edit**

    Forgot to select my prefix. I am running Visual Studio 2010 on XP.

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Project running old code instead of new

    Are you using dll references or project references?
    That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma

    Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney

  3. #3
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Project running old code instead of new

    Close VS, delete the bin folder.


    There is a bug where sometimes it will use the old exe, versus the new.

  4. #4
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Project running old code instead of new

    With the Solution Explorer visible select the current solution name.
    Right click and select Configuration Manager.
    Make sure the Build checkbox is checked for the project.

    If I have a solution with three projects, uncheck build on each one we get the following in the IDE output window upon build complete.
    Code:
    ========== Build: 0 succeeded or up-to-date, 0 failed, 3 skipped ==========
    And With all three
    Code:
    ========== Build: 3 succeeded or up-to-date, 0 failed, 0 skipped ==========
    So you could make changes in your code and if there is nothing to build you see you old code executing.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Posts
    241

    Re: Project running old code instead of new

    Thank you very much guys! A combination of these finally worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width