Visual Studio项目过期 [英] Visual Studio Project out of date

查看:838
本文介绍了Visual Studio项目过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图让Visual C ++工作,但是我建立每个项目时收到这个错误:这个项目已过期你想要构建它吗?它不能每次构建。



当我重建时,构建仍然失败,虽然在记录器中我没有注意到任何错误消息,这使我认为它没有正确记录(im使用第三方程序记录)



我遵循了以下一些说明: http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging .aspx 并启用日志记录。



我收到此错误:项目不是最新版本,因为在此插入文件名.lastbuildstate缺失。注意,在实际的视觉工作室,没有记录。我在google上找不到任何东西。这可能是我错误地启用日志记录,但我觉得这是错误。



我非常沮丧。我欣赏任何和所有的帮助。



谢谢

解决方案

什么是tlog / h2>

tlog文件是由Tracker.exe进程创建的,它会在你执行构建时运行,并记录一些关于构建的信息。



该信息在下次启动构建时使用和更新,以帮助检测过期文件,从而使构建系统只构建需要重建的位(而不是





导致过期问题的原因是什么?



问题可能是由于 *。tlog 文件。



有3种主要方式可以发生:



在硬盘上构建一个项目,然后将目录移动到另一个位置...tlog文件记录了旧位置的路径,但是因为你移动了文件,它们不再存在,因此你得到 of date。



2)您的Project引用了指定位置不存在的文件(通常是头文件)。如果您从源代码管理系统中删除了一个文件,但忘记将其从项目中删除,或者您引用的库的头文件可能已安装/存在于其他位置,则可能会出现这种情况。通常,开发人员假定文件位于每个人机器上的相同地点...不总是这样!



3)您已经做了一些重构您的项目,并将文件移动到不同的子目录,甚至重命名它们 - 所以记录在tlog中的文件的路径/名称不匹配您的磁盘上存在,即陈旧。



修复它的方法是什么?



执行清理+构建或重建并不总是解决它...操作不会删除tlog文件。所以:




  • 删除您可以在解决方案/项目目录中找到并且重建的任何tlog文件。



如何确定哪些文件不存在?



如果您想知道/确定Visual Studio正在认为哪些文件已过期,那么你可以在Visual Studio ....中打开一些诊断信息,并观察DebugView中的消息...显示它正在探测的文件的完整路径。





devenv.exe.config 中输入:

 < system.diagnostics> 
< switches>
< add name =CPSvalue =4/>
< / switches>
< /system.diagnostics>



更多详情



a解决方案和一组特定目录中的项目S:\MYPROJECTS,然后编译并运行/调试它等。



然后你决定将整个目录移动到驱动器上的其他位置, - 你的项目更改其目录名称等。



现在,当您执行开始调试/ F5时,Visual Studio会执行依赖检查,并认为您有过期文件。



即使您执行了清洁解决方案或重建解决方案....您仍然会收到过期文件 / p>

请参阅:





问题是由.tlog文件导致的,在依赖关系检查期间被查阅...当你移动解决方案/项目(与构建中间文件一起)时,会导致混乱Visual Studio构建器。



解决方案是删除所有的.tlog文件.....它们将在下一次构建时重新生成。 ..从这一点上你不会得到一个假的过期文件消息....除非他们真的是过时的。


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 (im using third party program to log)

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.

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.

I'm incredibly frustrated by this. I appreciate any and all help.

Thank you

解决方案

What are "tlog" files?

"tlog" files are created by the "Tracker.exe" process which runs while you do a build, and records some information about the build.

That information is used and updated the next time you start a build to help detect "out of date" files, and thus enable the build system to only build the bits that need to be rebuilt (rather than building everything again).

What causes the "out of date" problem?

The problem can be caused by incorrect or stale information in the *.tlog files.

There are 3 main ways that can happen:

1) You built a project on your hard disk, and then moved the directory to another location...the "tlog" files recorded the paths of the old location, yet because you moved the files, they are no longer there, thus you get "out of date".

2) Your "Project" has references to files (usually header files), which do not exist at the location specified. This might occur if you deleted a file from your source control system, but forgot to remove it from your project, or because you refer to header files of a library which might be "installed"/present at a different location. Often, Developers assume files are located at the same "place" on everyones machine....not always the case!

3) You have done some "refactoring" of your project, and moved files around to different subdirectories, or even renamed them - so the paths/names of the files recorded in the "tlog" do not match what exists on your disk i.e. stale.

What is the way to fix it?

Doing a "Clean+Build" or "Rebuild" does not always fix it...as those operations do not delete the "tlog" files. So:

  • delete any "tlog" files that you can find in your solution/project directories and rebuild.

  • make sure your Project does not refer to non-existent files

How do I work out which files are non-existent?

If you want to know/find out exactly which files Visual Studio is thinking are out of date, then you can turn on some diagnostic information in Visual Studio....and watch the messages in DebugView...showing the full path of the files it is probing.

In devenv.exe.config you put:

<system.diagnostics>
      <switches>
        <add name="CPS" value="4" />
      </switches>
    </system.diagnostics> 

More Details

Lets say you created a Solution and a set of Projects in a particular directory e.g. S:\MYPROJECTS, and you compile and run/debug it, etc.

You then decide to move that whole directory to somewhere else on your drive, or you re-factor your Projects e.g. change their directory names, etc.

Now when you do a "Start Debugging/F5", Visual Studio does the depending checking, and thinks you have "out of date files".

Even if you do a "Clean Solution", or a "Rebuild Solution"....you still get the "out of date files" message.

See here:

The problem is caused by the ".tlog" files which are being consulted during the dependency checks...when you moved the solutions/projects (along with a builds intermediate files) they cause confusion to the Visual Studio builder.

The solution is to delete all the .tlog files.....they will then be re-generated the next time you do a build...and from that point on you won't get a bogus "out of date files" message....unless they truly are out of date.

这篇关于Visual Studio项目过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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