16

I'm creating a typescript project (Project type - Web Application with Typescript), that includes typescript, javascript and other static files.

I'm using the Visual Studio 2015 build environment, and the Microsoft.TypeScript.MSBuild.1.8.11 nuget package for the actual compilation (i.e. not using tsconfig.json).

I have a Post-build event task which has the side effect of 'touch'ing some of these static files. When I subsequently trigger another build, I get a warning in the output*:

Project '<project name>' is not up to date.
Input file '<static file>' is modified after output file ''.`

and the project is forced to rebuild.

Can anyone think how I can work out what VS2015 is referring to when it talks about "output file ''"?

  • I've got MSBuild set to output Diagnostic information in the Tools->Options->Build And Run settings.
Rich Barber
  • 425
  • 3
  • 11

3 Answers3

20

I just deleted .vs folder & cleaned solution then worked fine.

enter image description here

Arun Prasad E S
  • 9,489
  • 8
  • 74
  • 87
7

To answer my own question - in the hope that it assists someone else.

The file VS reports as "output file ''", appears to relate to the output dll/pdb files in the bin folder, but also to the obj/$(Configuration) files that get built during the compilation process.

So, if I perform:

touch obj\Debug\myProj.dll obj\Debug\myProj.pdb
touch bin\myProj.dll bin\myProj.pdb

within my post-build task, then this seems to solve the problem and gets the compiler back to what I'd expect:

 ========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
Rich Barber
  • 425
  • 3
  • 11
  • There are other solutions to a similar problem here: https://stackoverflow.com/questions/21402633/visual-studio-2012-project-always-out-of-date-cs-modified – Thomas927 Oct 26 '17 at 20:49
  • I closed VS and then deleted the bin and obj folders. After that I was fine. – ADH Oct 15 '20 at 12:42
0

I had this problem and tried the solutions from this page without success. I eventually found out that the problem had a different cause in my case, related to project dependencies.

This happend to me in a large solution with many C# projects, configured using assembly file references, not project references. That is, the projects do not reference eachother explicitely; they have assembly file references to the DLLs which are produced by other projects in a big binary directory, with "copy local=false". I have only "build order dependencies" at the solution level, to ensure that projects build in a suitable order.

At some point, I refactored that code and moved a type from an assembly to another one, in order to break some unwanted dependencies. But I failed to update the assembly file references and build order dependencies accordingly. I ended up with a circular project build order dependency and assembly file reference (two projects were depending on eachother and referencing each other's DLL).

Visual studio did not complain about that and compiled the projects in an order that worked (probably by mere luck), but it was keeping compiling two thirds of the projects even when nothing had changed, and the logs mentioned the "Input file '<static file>' is modified after output file '' " weird message. Fixing the dependencies solved the problem.

graslany
  • 1
  • 1