問題描述
我一直在嘗試讓 Visual C++ 工作,但是在構建每個項目時我都收到此錯誤:此項目已過期"您要構建它嗎?"每次都無法構建.
I've been trying to get Visual C++ working, but I'm getting this error when building every project: "This project is out of date" "Would you like to build it?" It fails to build every time.
當我重建時,構建仍然失敗,盡管在記錄器中我沒有注意到任何錯誤消息,這讓我認為它沒有正確記錄(我正在使用第三方程序來記錄).
When I rebuild, the build still fails, although in the logger I don't notice any error messages, which makes me think its not logging properly (I'm using a third party program to log).
我已按照此處的一些說明進行操作:http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx 并啟用日志記錄.
I've followed some of the instructions here: http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx and enabled logging.
我收到此錯誤:項目不是最新的,因為在此處插入文件名".lastbuildstate 丟失.請注意,在實際的 Visual Studio 中,沒有記錄任何內容.我無法在谷歌中找到任何關于此的內容.可能是我錯誤地啟用了日志記錄,但我覺得這是錯誤.
I'm getting this error: project not up to date because "insert file name here".lastbuildstate is missing. Note that in actual visual studio, there is nothing logged. I was unable to find anything on this in google. It may be that I incorrectly enabled logging, but I feel that this is the error.
推薦答案
你應該讓 Visual Studio 告訴你為什么它需要重建.Visual Studio 2015 已內置對此的支持:
You should let Visual Studio tell you why it needs to rebuild. Visual Studio 2015 has built in support for this:
- 工具(菜單)
- 選項
- 項目和解決方案
- 構建和運行
將 MSBuild 項目構建輸出詳細程度更改為 詳細 或診斷.
Change MSBuild project build output verbosity to Detailed or Diagnostics.
在我的例子中,它打印了一條這樣的消息:
In my case it printed a message like this:
1>------ Up-To-Date check: Project: xyz, Configuration: xyz ------
1>Project not up to date because build input 'C:wsMissing.h' is missing.
...并從項目中刪除該標題解決了問題.
... and removing that header from the project fixed the problem.
要在較舊的 Visual Studio 版本中獲取此信息,您需要使用 DebugView 并修改 devenv.exe.config
(請參閱 Colin Smith 的回答:https://stackoverflow.com/a/21759835/1941779).請注意,此解決方案不適用于 Visual Studio 2015.
To get this information in older Visual Studio versions, you need to use DebugView and modify devenv.exe.config
(see Colin Smith's answer: https://stackoverflow.com/a/21759835/1941779). Note that this solution does NOT work for Visual Studio 2015.
這篇關于Visual Studio 項目已過期的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!