visual-studio 您想继续并运行上次成功的构建吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/596142/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:13:12  来源:igfitidea点击:

Would you like to continue and run the last successful build?

visual-studiovisual-studio-2008debuggingvisual-studio-2005

提问by joshuapoehls

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

您在 Visual Studio 中...您按 F5(运行)并看到此对话框:

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 neverpurposefully 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?

您是否经常在等待应用程序启动时不小心单击“是”并踢自己?

采纳答案by Michael Burr

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):

在 VS2008 中,您可以设置以下选项来更改行为(不确定其他版本的 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).

将上述选项设置为“始终构建”和“不启动”,您会得到我认为更糟糕的行为。虽然有时当我尝试启动调试器并且出现构建错误时,我需要几秒钟才能意识到为什么我没有到达我认为我会击中的断点(获得某种“烤面包机”可能会很好) ' 类型的消息让我从昏迷中醒来)。

回答by Michael Burr

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

您可以在此处选择: - 启动旧版本 - 不启动 - 要求启动

回答by cdonner

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.

当您调试 Web 应用程序并且其中一个页面无法编译时,这会很有用,因为其他开发人员签入了错误版本,或者您因任何原因无法签出最新代码,但您知道自己不会命中那个页面。我总是这样做。

回答by lc.

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.

然而,这很有用的一个原因是,如果您想提醒自己您正在处理的错误是什么。并非所有事情都可以在编辑和继续中修复,您可能需要记忆点动。

回答by kemiller2002

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.

它对 Web 应用程序也很有帮助,因为它会强制启动 cassini 服务器。如果您正在处理无法编译的解决方案中的一个项目,并且您需要刷新另一个项目中的 Web 服务,则您需要此选项。

回答by kemiller2002

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.

它适用于在运行时选择合适的 dll 的偏好。如果存在任何构建错误,则不会生成可执行文件,因此编译器会查找存在的可执行文件,这显然是最后一次成功编译的文件。

回答by Terry

When using VS 2008 Express, there is a box to never show this dialog again. Just tried it and it will take away the dialog, leaving only a build failed message in the bottom left hand portion of the screen.

使用 VS 2008 Express 时,有一个框不再显示此对话框。刚刚试了一下,它会取消对话框,只在屏幕左下角留下一条构建失败的消息。

As for how often do I hit it, quite often. Frustrating as sometimes I have changed the code complete while testing things and will get something completely unrelated to the task at hand. Not sure when Microsoft figured this would be useful.

至于我多久打一次,很频繁。令人沮丧的是,有时我在测试时更改了完整的代码,并且会得到与手头任务完全无关的东西。不确定微软何时认为这会有用。