Visual Studio Project out of date

本文介绍了Visual Studio中tlog文件的作用及其可能导致的构建问题。当项目位置变动、引用不存在的文件或重构项目时,tlog文件可能会包含过时的信息,导致出现“文件过期”的错误。文章提供了诊断和修复这些问题的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >



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.

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.

### 配置 OLAP 功能于 Visual Studio 2022 要在 Visual Studio 2022 中实现或配置 OLAP(联机分析处理),可以按照以下方法完成设置: #### 安装 SQL Server Data Tools (SSDT) 为了在 Visual Studio 2022 中使用 OLAP 功能,首先需要确保已安装 **SQL Server Data Tools (SSDT)** 插件。此插件允许开发者创建和管理 Analysis Services 项目。 1. 打开 Visual Studio Installer 并选择修改当前安装的版本。 2. 在工作负载选项卡下,找到并勾选 **“数据存储与处理”** 工作负载[^4]。 3. 单击下一步并等待安装完成。 #### 创建 Analysis Services 项目 一旦 SSDT 被成功安装,在 Visual Studio 2022 中即可创建一个新的 Analysis Services 项目。 ```plaintext File -> New -> Project... ``` 在弹出窗口中搜索 `Analysis Services` 或者直接浏览至 Business Intelligence 类型下的模板。选择 **Analysis Services Multidimensional and Data Mining Project** 模板来启动一个多维数据分析项目[^4]。 #### 数据源与数据源视图配置 - **创建数据源**: 在解决方案资源管理器里右键点击 “Data Sources”,然后选择新建数据源。这一步骤涉及连接到数据库实例,通常是一个包含事实表和维度表的关系型数据库。 - **建立数据源视图**: 接下来要构建一个逻辑模型表示实际的数据结构。通过拖拽相关表格进入设计区域形成所需的数据源视图。 #### 维度建模 - 开始定义各个业务实体对应的维度对象。这些可能包括时间、地理位置、产品类别等等属性集合体。每一个维度都由一组层次结构组成便于后续钻取操作执行。 #### 多维数据集构建 - 基于之前准备好的维度以及来自关系型数据库的事实数值字段,组装成最终供查询使用的立方体形式即多维数据集。在此过程中还可以添加计算成员增强报表灵活性[^3]。 #### 测试与部署 最后阶段是对整个方案进行全面验证确保存储过程无误之后再将其推送至生产环境服务器端运行。利用内置模拟客户端工具或者第三方BI前端展现层应用比如Power BI Desktop来进行效果评估也是常见做法之一。 ```python # 示例 Python 脚本调用 Excel 显示 SSAS 结果 import pyodbc server = 'localhost' database = 'AdventureWorksDW2017' username = '' password = '' driver= '{SQL Server}' cnxn = pyodbc.connect('DRIVER='+driver+';SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password) cursor = cnxn.cursor() query = """ SELECT NON EMPTY { [Measures].[Internet Sales Amount] } ON COLUMNS, NON EMPTY { ([Date].[Calendar Year].members ) } ON ROWS FROM [Model] """ df = pd.read_sql(query,cnxn) print(df.head()) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值