Team -

HELP!!! I have broken my code and it can't get up!

When I go to run my application within Visual Studio I get the dreaded "There are build errors. Would you like to continue and run from last successful build?"

That build runs fine, but how do I restore it to my current project?????

Thanks!

Dani AI

Generated

The "There are build errors. Would you like to continue and run from last successful build?" message only runs the last-compiled binaries from the project's bin folder; it does not revert source files. That is why the app may appear to run while the code in Solution Explorer still fails to compile. 's symptom therefore requires restoring source or fixing the compile errors, not "rolling back" from that dialog.

Quick recovery checklist (least to most destructive):

  • Make a full copy of the entire project folder before any destructive action.

  • Inspect the Error List and Output windows to find the exact compile errors; missing references or recent file renames are common causes.

  • Try Clean Solution then Rebuild Solution (as suggested). If that fails, close Visual Studio, delete the project’s bin and obj folders, reopen and rebuild.

  • If the project is under source control, restore from history. For Git, common commands:

    git status
    git log --oneline
    git checkout -- path/to/file        # restore single file to last committed state
    git reset --hard <commit-hash>      # reset branch to a known good commit (destructive)
    git revert <commit-hash>            # create a new commit that undoes a bad commit

    For TFS/VSS use the file history / "Get Specific Version" or rollback options in Source Control Explorer.

  • If no source control exists, check backups, Windows "Previous Versions"/File History, or (as a last resort) decompile the assemblies in bin with a .NET decompiler to recover code. Creating a new project and importing forms (as suggested) works but may lose project settings; treat that as a fallback.

Prevention: put all projects under version control, commit frequently, push to a remote, and keep external backups so future rollbacks are fast and non-destructive.

Recommended Answers

All 3 Replies

I would say create a new project then import the forms you have created from the former project

Hi,

What you can try, I haven't had that problem yet.
Go to the solution explorer, right click your application and rebuild your application and then save all.

I hope it helps.

Yea, I tried the rebuild but it didn't work. The program was small so I was able to just start over but I am working on a larger one that if this happens it would cause me a major setback. I still have the bad project, I will give this a try and post back just to make sure I have covered our bases.

It sees that if it will let me "run from last good build" that it would have some way to revert.

Thanks everyone.
Dewayne

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.