除非我手动选择“重建",否则 Visual Studio 2010 不会重建更改的代码. [英] Visual Studio 2010 doesn't rebuild changed code unless I manually select "Rebuild"

查看:34
本文介绍了除非我手动选择“重建",否则 Visual Studio 2010 不会重建更改的代码.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去一周左右的时间里,我注意到 Visual Studio 2010 不会重新编译代码,除非我强迫它重新编译.这是一个带有 WPF 的 C# 4.0 项目.如果代码已更改,我点击 F5,它似乎使用了重建,然后启动应用程序.相反,它现在在左下角的状态栏中显示构建成功"并启动应用程序.不过,它实际上并没有重建应用程序.我可以说是因为:

In the past week or so, I've noticed that Visual Studio 2010 is not recompiling code unless I force it to. This is a C# 4.0 project with WPF. I hit F5, which seems like it used rebuild, if the code had changed, and then launch the app. Instead, it now says in the bottom left status bar "Build Successful" and launches the application. It doesn't actually rebuild the app, though. I can tell because:

  1. 即使我进行了大量更改,它也能很快编译"并且
  2. 如果我尝试设置断点,它会给出代码已更改但未更改的警告设置断点.

无论代码中是否存在错误,都会发生这种情况,所以我不认为如果构建失败,它会启动旧版本.

This happens regardless of whether there are errors in the code or not, so I don't believe it's the thing where it launches an older version if the build fails.

如果我改为从菜单中选择重建项目,它就会工作.然而,这会妨碍我通常的工作流程.我经常忘记这样做,然后花 10 分钟试图弄清楚我的更改到底出了什么问题.更糟糕的是,有时我没有立即注意到构建错误.

If I instead select from the menu to rebuild the project, it then works. This kind of impedes my usual workflow, however. I semi-frequently forget to do this, and then spend 10 minutes trying to figure out what the hell is wrong with my changes. Even worse, sometimes there are build errors that I don't notice right away.

F6 来重建"解决方案也没有任何作用.哪些设置可能会导致这种行为?

Pressing F6 to "rebuild" the solution does not do anything either. What settings might I have mucked with that would cause this behavior?

推荐答案

啊,我想通了.在一个太晚的夜晚之后,当我搞乱构建设置时,我自然而然地做了一些愚蠢的事情.以下是需要检查的事项:

Gah, I figured this out. It was naturally something stupid I did when messing around with build settings after a too-late night. Here are the things to check:

  1. 工具>>选项>>项目和解决方案>>构建和运行>>检查运行时,项目过期时"是否设置为始终构建"或提示构建"
  2. 构建 >> 配置管理器 >> 为您需要使用的每个配置检查要构建的所有项目是否选中了构建".

这篇关于除非我手动选择“重建",否则 Visual Studio 2010 不会重建更改的代码.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆