Would you like to continue and run the last succes

2019-01-22 06:11发布

You're in Visual Studio... you press F5 (Run) and are greeted by this dialog:

There were build errors. Would you like to continue and run the last successful build?

Wonderful.

I'm sure there are cases where running the last successful build is useful, however, I have never purposefully answered yes to this question. Oh sure, I've clicked Yes plenty of times, and waiting in frustration for the first opportunity to undo my blunder, but nothing more.

So, have you ever found this feature useful? And if so, under what circumstances did it become helpful for you to be able to run the last successful build of your application?

How often do you accidentally click Yes and kick yourself while waiting for the app to start?

7条回答
beautiful°
2楼-- · 2019-01-22 06:19

This can be useful when you debug a web application and one of the pages does not compile, because some other developer checked in a bad version, or you can't check out the latest code for whatever reason, but you know you will not hit that page. I do it all the times.

查看更多
对你真心纯属浪费
3楼-- · 2019-01-22 06:22

It works on the preference of selection of appropriate dll on runtime. Executables are not generated if there is any built error so the compiler looks for the executable which is existing which is obviously the last successful compiled.

查看更多
狗以群分
4楼-- · 2019-01-22 06:36

Interesting. I've actually never seen that dialog - I know there's an option to enable/disable running the previous successful build, so perhaps it shows a dialog first. You can look into disabling it if you won't use it.

One reason this can be useful, however, is if you want to remind yourself what the bug was that you were working on. Not all things can be fixed in edit-and-continue, and you might need a memory jog.

查看更多
时光不老,我们不散
5楼-- · 2019-01-22 06:39

In VS2008 there are the following options you can set to change the behavior (not sure if there are similar options in other versions of Visual Studio):

Projects and Solutions/Build and Run

    - On Run, when projects are out of date:

          Always build
          Never build
          Prompt to build <== default setting

    - On Run, when build or deployment errors occur:

          Launch old version
          Do not launch
          Prompt to launch <== default setting

Set the above options to "Always build" and "Do not launch" and you get what I consider a more ueseful behavior. Though sometimes when I try to launch the debugger and there's a build error it takes me a few seconds to realize why I'm not getting to the breakpoint I thought I'd be hitting (it might be nice to get some sort of 'toaster' type of message to knock me out of my stupor).

查看更多
再贱就再见
6楼-- · 2019-01-22 06:42

This behaviour can be defined under Tools->Options->Projects and Solutions->Build And Run-> On Run, when Build or Deployment Errors occur

here you can select: - Launch old version - Do not launch - Ask to launch

查看更多
你好瞎i
7楼-- · 2019-01-22 06:42

It's also helpful on web applications, because it will force the cassini servers to start. You need this if you are working on one project in the solution that won't compile, and you need to refresh the web services in another project.

查看更多
登录 后发表回答