【问题标题】:How can I get rid of mysterious warning: "'../project.csprojAssemblyReference.cache' already exists"?我怎样才能摆脱神秘的警告:“'../project.csprojAssemblyReference.cache'已经存在”?
【发布时间】:2019-07-28 15:33:56
【问题描述】:

在构建我的一些类库 csprojs 时出现以下警告:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3101: Could not write state file "..\..\tmp\dotnet\anvil.controls\obj\vs2017\net461\debug
\anvil.controls.vs2017.net461.csprojAssemblyReference.cache". The file 'E:\anvil\Anvil.Controls\tmp\dotnet\anvil.controls\obj\vs2017\net461\debug\Anvil.Controls.vs2017.net461.csprojAssemblyReference.cache' already exists. [E:\anvil\Anvil.Controls\src\anvil.controls\anvil.controls.vs2017.net461.csproj]
  • 我尝试过使用 msbuild 15.0(VS2017 和 Standalone 2.2.103)和 16.0。
  • Visual Studio 2017 和 JetBrains.Rider 中的相同警告
  • 如果我擦除我的临时文件夹,则不会发生。然后在后续构建甚至重建中发生。
  • 发生在我项目的一个子集上,我能看到的唯一相似之处是它们都是包含 .xaml 文件的项目。但并非所有具有 .xaml 文件的项目都会发生这种情况。
  • 当我使用 -maxcpucount:1(禁用并行构建)时发生。
  • 每个项目都有一个唯一的 tmp/intermediate 文件夹,设置为:..\..\tmp\dotnet\ubisoft.controls\<bin|obj>\vs2017\net45\<debug|release>\

任何想法可能会影响我的项目中的此错误?

【问题讨论】:

  • 您能否阐明您执行了何种构建自定义以使用自定义中间输出路径(临时文件夹)?缓存文件的文件名似乎不正确
  • 在我的问题中添加了 tmp/中间路径。谢谢!
  • 也只有IntermediateOutputPathBaseIntermediateOutputPath
  • 我的 .csproj 文件中仅设置了 IntermediateOutputPath

标签: msbuild


【解决方案1】:

有时“神秘警告”(和错误)来自太长的路径。尝试使用较短的输出路径,即

E:\build\Anvil.Controls\tmp\net461\debug\

而不是

E:\anvil\Anvil.Controls\tmp\dotnet\anvil.controls\obj\vs2017\net461\debug\

也见this answer

【讨论】:

    猜你喜欢
    • 2011-03-12
    • 2023-01-29
    • 2012-12-26
    • 1970-01-01
    • 2021-11-01
    • 2021-01-27
    • 2020-08-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多