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

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

问题描述

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

In project file I import my own target file

<Import Project="Build\CopyDependencies.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天全站免登陆