如何停止 Visual Studio 缓存导入的 MSBuild 脚本? [英] How to stop Visual Studio caching Imported MSBuild scripts?

查看:53
本文介绍了如何停止 Visual Studio 缓存导入的 MSBuild 脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 csproj 文件,它引用了一个带有 指令的共享 MSBuild 脚本.我注意到,当我更改共享脚本时,我需要在它注意到更改之前关闭并重新打开 Visual Studio - Visual Studio 中的构建会注意到对 csproj 文件的更改,但不是共享文件.

I have a csproj file which references a shared MSBuild script with an <Import> directive. I have noticed that when I change the shared script, I need to close and reopen Visual Studio before it notices the change - a build within Visual Studio notices changes to the csproj file but not the shared file.

当我从命令行使用 MSBuild 构建项目时,不会发生这种情况.Visual Studio 是否缓存导入的脚本?如果是这样,为什么?以及如何关闭这种使使用 Visual Studio 创作构建脚本变得困难/不可能的行为?

This doesn't happen when I build the project with MSBuild from the command line. Is Visual Studio caching the imported script? If so, why? And how can I turn off this behaviour which makes authoring build scripts hard / impossible using Visual Studio?

谢谢!

推荐答案

您是否尝试过卸载并重新加载导入共享脚本的项目 (.csproj),而不是关闭并重新打开 Visual Studio?您可以在 Visual Stduio 中的解决方案资源管理器中执行此操作,方法是右键单击加载的项目并选择卸载,然后选择卸载的项目并选择加载.

Instead of closing and re-opening Visual Studio have you tried, unloading and reloading the project (.csproj) which imports the shared script? You can do this from the Solution Explorer in Visual Stduio by right clicking on the loaded project and selecting unload and then on the unloaded project and picking load.

这篇关于如何停止 Visual Studio 缓存导入的 MSBuild 脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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