如何在 Visual Studio 中关闭构建定义的缓存 [英] How to turn off caching of build definitions in Visual studio

查看:14
本文介绍了如何在 Visual Studio 中关闭构建定义的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在项目文件中我导入自己的目标文件

In project file I import my own target file

<Import Project="BuildCopyDependencies.target" />

然后我从那个目标文件调用目标

and later I call target from that target file

<CallTarget Targets="CopyDependencies" UseResultsCache="false" />

如果我编辑 CopyDependencies.target 文件,我必须重新加载整个解决方案,然后对 CopyDependencies.target 的更改才会生效.我相信这是在 Visual Studio 中缓存的某种构建定义?如果是的话,也许可以关掉?

If I edit CopyDependencies.target file I have to reload whole solution and only then changes to CopyDependencies.target take effect. I believe it is some sort of build definitions caching in Visual Studio? If it is, maybe it can be turned off?

推荐答案

感谢@KazR

这是一个较小的解决方案,您可以将其插入到您的 .csproj 文件中

Here is a smaller Solution that you can insert into your .csproj file

<Target Name="AfterBuild">
  <PropertyGroup>
    <TempProjectFile>Build.$([System.Guid]::NewGuid()).proj</TempProjectFile>
  </PropertyGroup>
  <Copy SourceFiles="Build.proj" DestinationFiles="$(TempProjectFile)" />
  <MSBuild Projects="$(TempProjectFile)" />
  <ItemGroup>
    <TempProjectFiles Include="Build.????????-????-????-????-????????????.proj"/>
  </ItemGroup>
  <Delete Files="@(TempProjectFiles)" />
</Target>

问题解决了

这篇关于如何在 Visual Studio 中关闭构建定义的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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