本文介绍了将 Makefile 项目添加到 Visual Studio 2015 解决方案总是过时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当大的解决方案(80 个项目).最近我升级到 VS2015U1 并修改了解决方案以包含一个 makefile (nmake) 项目,这是所有其他项目的先决条件.其目的是该 makefile 应将一些第三方软件复制到项目的 bin 目录中,以便更轻松地将内容组合在一起进行测试和打包.

I have a rather large solution (80 projects). Recently I upgraded to VS2015U1 and modified the solution to include a makefile (nmake) project that is a prerequisite to all other projects. The intention was that this makefile should copy some third party software into the project's bin directory to make it easier to bring things together for testing and packaging.

问题是,这个 makefile 项目似乎总是过时的.这意味着当您按 F5 进行测试时,我总是会弹出一个对话框.

The problem is, this makefile project always appears to be out-of-date. This mean I always get a dialog popup when you hit F5 to test.

我一直在 Google 上搜索,直到我的 Google 员工感到疼痛为止,包括我在 stackoverflow 上找到的所有内容.列出的解决方案似乎都没有帮助:

I've Googled till my Googler was sore, including everything I found on stackoverflow. None of the solutions listed appear to help:

  • 没有为该项目列出任何文件,因此没有文件是过时的.我什至把 makefile 本身作为一个项目文件,但这并没有帮助.
  • 我通过以下方式向 makefile 项目添加了一个假输出文件将其包含在属性中,并导致生成文件运行时之一.
  • 我已将构建输出详细级别设置为诊断级别,并且已经结束广泛地通过 .log 文件并没有找到任何文件的提示已丢失或已过期.
  • 其他项目似乎都没有重建,只有一个生成文件项目.当 makefile 运行时,一切似乎都由将要复制的文件的最新信息.
  • 没有与新项目相关的 .tlog 文件.
  • 进行干净的构建或重建无济于事,这个项目总是过时的.

有人有其他想法吗?

推荐答案

由于 Visual Studio 使用的 MSBuild 与 nmake 的用途相同,我只是将 nmake 项目替换为 .csproj 文件中的直接 MSBuild 项目并添加它作为我的解决方案的一个项目,使其他项目依赖于它.它不会在启动调试器时弹出项目过期对话框,并且它会正确识别我要创建的文件何时过期.

Since MSBuild, which Visual Studio uses, serves the same purpose as nmake, I just replaced the nmake project with a straight MSBuild project in a .csproj file and added it as a project to my solution, making the other projects depend on it. It doesn't pop-up that project-out-of-date dialog on starting the debugger, and it properly recognizes when the files I want to create are out of date.

有关如何指定构建目标的参考,请参阅 MSBuild 文档

See the MSBuild documentation for reference on how to specify build targets, etc.

这篇关于将 Makefile 项目添加到 Visual Studio 2015 解决方案总是过时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-19 06:29