首页 > 解决方案 > Visual Studio 错误 MSB3491:该进程无法访问该文件,因为它被另一个进程使用,在下一次构建后消失

问题描述

我在使用 Visual Studio 2019 时遇到问题。构建解决方案时出现错误:

Error: MSB3491  Could not write lines to file

The process cannot access the file '..bin\objects\core\Release\x64\core.tlog\core.write.1u.tlog' 
because it is being used by another process. FILE: ..\QtMsBuild\qt_globals.targets  line: 407

这导致我到第 407 行:

<WriteLinesToFile Condition="'@(clean_log)' != ''"
  File="$(TLogLocation)$(ProjectName).write.1u.tlog"
  Lines="^%(clean_log.Source);@(clean_log->'%(Fullpath)')"
  Encoding="Unicode"/>

再次运行构建后,此错误消失,这是奇怪的部分。我在这里发现了一些类似的问题 MSB3491:https ://developercommunity.visualstudio.com/content/problem/890376/custom-build-step-leads-to-error-msb3491-could-not.html 。但是这个解决方案对我不起作用。

标签: visual-studioqtcompiler-errors

解决方案


这是 QT 中的一个错误,他们已经发布了修复但我还没有尝试过。这是 Qt 错误跟踪报告:https ://codereview.qt-project.org/c/qt-labs/vstools/+/332804 。


推荐阅读