在VS2013中单击生成时始终运行的MSBuild Target [英] MSBuild Target that always runs when clicking build in VS2013

查看:175
本文介绍了在VS2013中单击生成时始终运行的MSBuild Target的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当您在VS2013中单击项目的构建时,我都想运行目标.我尝试了几种方法,包括将项目的DefaultTargets更改为自定义项目,然后让自定义目标调用我的目标,然后调用Build.但是,问题在于它只能运行一次.如果我再次运行它,它似乎什么也没运行.

I want to run a target whenever you click build for the project in VS2013. I tried several ways including changing the DefaultTargets of the project to something custom and then have the custom target call my target and then Build. However, the problem is that it only works once. If I run it again, it doesn't seem to run anything.

反正有这样做吗?

推荐答案

我想出了一个解决方案.我的主要问题是VS2013不再检查文件是否没有更改.我需要将其添加到我的项目文件中.

I came up with a solution. My major problem was that VS2013 was no longer checking if the files didn't change. I needed to add this to my project file.

   <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>

在我的特定情况下,这是一个webapp项目.可能有更简单的方法,但是我最后想到的是这个.

In my particular case this was a webapp project. There are probably simpler ways, but what I wound up with was this.

我将标记中的DefaultTargets更改为"CustomBuild"

I change DefaultTargets in the tag to "CustomBuild"

然后,我创建了一个这样的目标.

Then, I created a target like this.

  <Target Name="CustomBuild">
    <CallTarget Targets="<my custom target>" />
    <CallTarget Targets="Build" />
  </Target>

现在,每次我单击构建时,它将运行<我的自定义目标>

Now, everytime I click build it will run <my custom target>

这篇关于在VS2013中单击生成时始终运行的MSBuild Target的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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