为什么Visual Studio会重新编译非脏项目?

时间:2022-09-01 08:12:02

I have a solution with a couple of projects with inter dependencies.

我有一个具有相互依赖性的项目的解决方案。

When I make a change in a project and recompile, Visual Studio recompiles all projects, regardless of whether I changed them (or any of their precedents) or not.

当我在项目中进行更改并重新编译时,Visual Studio会重新编译所有项目,无论我是否更改它们(或其任何先例)。

I am using only C# projects. I tried cleaning the output - no change. I checked the dates of my files - no future date.

我只使用C#项目。我试着清理输出 - 没有变化。我检查了我的文件的日期 - 没有未来的日期。

Has anyone seen this behavior? Is there a cure for it?

有没有人见过这种行为?它有治愈方法吗?

2 个解决方案

#1


One possible cause for this problem is incorrect time stamps on your files. Check the files in your project and make sure they are not time stamped at some point in the future.

导致此问题的一个可能原因是文件上的时间戳不正确。检查项目中的文件,确保它们在将来的某个时间没有加盖时间戳。

#2


when you make a change to the project file you may change the include paths or the include path order. clearly this could change the result of the build even if you change the content of no header file. there are limits to the dependency checking. i don't know for sure exactly what is checked and how the dependencies are calculated but i would certainly prefer it to do the build rather than miss a dependency.

当您对项目文件进行更改时,您可以更改包含路径或包含路径顺序。显然,即使您更改了无头文件的内容,这也可能会改变构建的结果。依赖性检查有限制。我不确定究竟检查了什么以及如何计算依赖关系,但我当然更喜欢它来进行构建而不是错过依赖。

#1


One possible cause for this problem is incorrect time stamps on your files. Check the files in your project and make sure they are not time stamped at some point in the future.

导致此问题的一个可能原因是文件上的时间戳不正确。检查项目中的文件,确保它们在将来的某个时间没有加盖时间戳。

#2


when you make a change to the project file you may change the include paths or the include path order. clearly this could change the result of the build even if you change the content of no header file. there are limits to the dependency checking. i don't know for sure exactly what is checked and how the dependencies are calculated but i would certainly prefer it to do the build rather than miss a dependency.

当您对项目文件进行更改时,您可以更改包含路径或包含路径顺序。显然,即使您更改了无头文件的内容,这也可能会改变构建的结果。依赖性检查有限制。我不确定究竟检查了什么以及如何计算依赖关系,但我当然更喜欢它来进行构建而不是错过依赖。