4

I've been trying to get typescript building via the build servers on visualstudio.com, and I've done the normal thing of bringing typescript into source control. But I'm getting the following issue:

VSTSC : error TS5007: Build: Cannot resolvereferenced file: 'COMPUTE_PATHS_ONLY'. [C:\a\src\Main\RecruitCloud\RecruitCloud.csproj]

I'm aware of the encoding issues, but in all the examples I've seen the culprit file has been named in the error message.

I'm starting to think this could be down to the number of typescript files I'm compiling in the project.

Any ideas?

RubbleFord
  • 7,456
  • 9
  • 50
  • 80
  • same error here after upgrading to visual studio update 3 – Robert Ivanc Oct 08 '14 at 11:19
  • do you have by any chance .net demon installed? After I disabled it the error went away – Robert Ivanc Oct 08 '14 at 11:28
  • No I don't and the build server is a hosted azure build agent so I fairly sure this isn't the issue. – RubbleFord Oct 09 '14 at 16:31
  • hm, for me it started when updating to VS 2013 update 3. It seems .net demon just makes it appear more frequently. – Robert Ivanc Oct 22 '14 at 09:48
  • similar issue: [questions/17189118/after-upgrading-to-ts-0-9-i-get-ts5007-cannot-resolve-referenced-file-how-do](https://stackoverflow.com/questions/17189118/after-upgrading-to-ts-0-9-i-get-ts5007-cannot-resolve-referenced-file-how-do) – Ryan Vincent Dec 09 '14 at 22:24

2 Answers2

6

This is a configuration option for the VsTsc task, the one that runs the compiler. It is used in the PreComputeCompileTypeScript target. The intention is to make the VsTsc task go through all the motions, except to run the compiler. That didn't pan out on your machine, it actually did run the compiler. Which then threw a fit since it can't find a file named COMPUTE_PATHS_ONLY.

The VsTsc task is stored in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\TypeScript.Tasks.dll. Looking at the assembly with a decompiler:

protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands)
{
    if (this.Configurations.Contains("--sourcemap"))
    {
        this.generateSourceMaps = true;
    }
    else
    {
        this.generateSourceMaps = false;
    }
    if (this.Configurations.Contains("--declaration"))
    {
        this.generateDeclarations = true;
    }
    else
    {
        this.generateDeclarations = false;
    }
    this.GenerateOutputPaths();
    if (!responseFileCommands.Contains("COMPUTE_PATHS_ONLY"))
    {
        return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands);
    }
    return 0;
}

Note the !responseFileCommands.Contains() test to bypass the base.ExecuteTool() call.

All I can guess is that the method doesn't look like this on your machine. With the most likely cause that you have an outdated version of TypeScript.Tasks.dll. On my machine with VS2013 Update 4 installed it is dated Nov 11, 2014 with a size of 27816 bytes.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • I de-compiled my `TypeScript.Tasks.dll`, and it does match yours. I did a full repair install of Visual Studio, issue persists. I'm a bit perplexed because the symptoms suggest you are right. – jbtule Dec 15 '14 at 21:52
  • Bummer, thought it was the slamdunk explanation. I need to see a detailed msbuild trace to come up with another theory. – Hans Passant Dec 15 '14 at 22:30
  • Detailed shows it's loading v11/TypeScript.Task.dll `Target "PreComputeCompileTypeScript" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets" from project "C:\Users\jayt\Documents\Visual Studio 2013\Projects\taglich.fix\AdminMVC\AdminMVC.csproj" (target "CompileTypeScript" depends on it): Using "VsTsc" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript\TypeScript.tasks.dll".` I still have to figure out why. – jbtule Dec 15 '14 at 23:01
  • I'm using vs2012 and I get the same error "Build: Cannot resolvereferenced file: 'COMPUTE_PATHS_ONLY'" and I decompiled the dll and I see that Im missing the !responseFileCommands.Contains("COMPUTE_PATHS_ONLY") is there any version of this dll for vs2012 with this validations where I can download this? – Goca Mar 18 '15 at 23:03
0

Your best bet would be to simply resave all the files in Unicode encoding. You can do it from a quick powershell script (Change files' encoding recursively on Windows?)

Get-ChildItem *.txt | ForEach-Object {
$content = $_ | Get-Content

Set-Content -PassThru $_.Fullname $content -Encoding UTF8 -Force}
Community
  • 1
  • 1
basarat
  • 261,912
  • 58
  • 460
  • 511