Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS 2015 remote debugging fails when using TypeScriptCompile #7117

Closed
Cristi003 opened this issue Feb 17, 2016 · 1 comment
Closed

VS 2015 remote debugging fails when using TypeScriptCompile #7117

Cristi003 opened this issue Feb 17, 2016 · 1 comment
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@Cristi003
Copy link

VS Typescript Extension version: 1.7.6

Steps to reproduce

Create a javascript windows app and add a typescript file in a sub-folder. Modify the .jsproj and import the msbuild typescript targets.
Trigger remote debugging build in VS2015.

Result

2>Copying file "C:\Users\someuser\vsproject\projname\src\default.js" to layout "src/default.js"...
2>Error : DEP2100 : Cannot copy the file "C:\Users\someuser\vsproject\projname\src\default.js" to the target machine "192.168.2.4". 
2>Error : DEP2100 : Cannot copy the file "C:\Users\someuser\vsproject\projname\src\default.js" to the target machine "192.168.2.4". 
2>The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
2>Deployment of the application to the target device failed.

Issue seems to be that the layout has path with forward slash which are not valid network paths in Windows. The path comes from Content Include defined in the typescript targets.

MSBuild log for typescript target

1>Target "PreComputeCompileTypeScript: (TargetId:43)" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets" from project "C:\Users\someuser\vsproject\projname\projname.jsproj" (target "CompileTypeScript" depends on it):
1>                   Using "VsTsc" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\TypeScript.tasks.dll".
1>                   Task "VsTsc" (TaskId:37)
1>                     Task Parameter:ToolPath=C:\Program Files (x86)\Microsoft SDKs\TypeScript (TaskId:37)
1>                     Task Parameter:ToolExe=tsc.exe (TaskId:37)
1>                     Task Parameter:Configurations= --removeComments --sourcemap --target ES5 --emitBOM --noEmitOnError --locale en-US COMPUTE_PATHS_ONLY (TaskId:37)
1>                     Task Parameter:
1>                         FullPathsToFiles=
1>                             src\default.ts  (TaskId:37)
1>                     Task Parameter:YieldDuringToolExecution=True (TaskId:37)
1>                     Task Parameter:ProjectDir=C:\Users\someuser\vsproject\projname\ (TaskId:37)
1>                     Task Parameter:ToolsVersion=1.7 (TaskId:37)
1>                     Task Parameter:TypeScriptCompileBlocked=False (TaskId:37)
1>                     Output Item(s):
1>                         GeneratedJavascript=
1>                             src/default.js
1>                                     DestinationRelativePath=src/default.js
1>                             src/default.js.map
1>                                     DestinationRelativePath=src/default.js.map (TaskId:37)
1>                   Done executing task "VsTsc". (TaskId:37)
1>                   Task "AssignTargetPath" (TaskId:38)
1>                     Task Parameter:
1>                         Files=
1>                             src/default.js
1>                                     DestinationRelativePath=src/default.js
1>                             src/default.js.map
1>                                     DestinationRelativePath=src/default.js.map
1>                     Task Parameter:RootFolder=C:\Users\someuser\vsproject\projname (TaskId:38)
1>                     Output Item(s):
1>                         GeneratedJavascriptWithTargetPath=
1>                            src/default.js
1>                                     DestinationRelativePath=src/default.js
1>                                     OriginalItemSpec=src/default.js
1>                                     TargetPath=src/default.js
1>                             src/default.js.map
1>                                     DestinationRelativePath=src/default.js.map
1>                                     OriginalItemSpec=src/default.js.map
1>                                     TargetPath=src/default.js.map (TaskId:38)
1>                   Done executing task "AssignTargetPath". (TaskId:38)
1>                   Added Item(s):
1>                       FilesForPackagingFromProject=
1>                           src/default.js
1>                                   DestinationRelativePath=src/default.js
1>                                   OriginalItemSpec=src/default.js
1>                                   TargetPath=src/default.js
1>                           src/default.js.map
1>                                   DestinationRelativePath=src/default.js.map
1>                                   OriginalItemSpec=src/default.js.map
1>                                   TargetPath=src/default.js.map
1>                   Added Item(s):
1>                       ContentWithTargetPath=
1>                           src/default.js
1>                                   DestinationRelativePath=src/default.js
1>                                   OriginalItemSpec=src/default.js
1>                                   TargetPath=src/default.js
1>                           src/default.js.map
1>                                   DestinationRelativePath=src/default.js.map
1>                                   OriginalItemSpec=src/default.js.map
1>                                   TargetPath=src/default.js.map
1>                   Added Item(s):
1>                       Content=
1>                           src/default.js
1>                                   CopyToOutputDirectory=Never
1>                                   DestinationRelativePath=src/default.js
1>                          src/default.js.map
1>                                   CopyToOutputDirectory=Never
1>                                   DestinationRelativePath=src/default.js.map
1>22:32:28.195     1>
1>Done building target "PreComputeCompileTypeScript" in project "projname.jsproj".: (TargetId:43)

Workaround

Patch PreComputeCompileTypeScript target in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets to replace forward slash with backslash

      <Output TaskParameter="GeneratedJavascript" ItemName="GeneratedJavascriptX" />
    </VsTsc>
    <ItemGroup>
      <GeneratedJavascript Include="@(GeneratedJavascriptX->'%(Identity)'->Replace('/', '\'))">
        <DestinationRelativePath>%(DestinationRelativePath).Replace('/', '\')</DestinationRelativePath>
      </GeneratedJavascript>
    </ItemGroup>
@paulvanbrenk
Copy link
Contributor

This is fixed in 1.8 final

@paulvanbrenk paulvanbrenk added Bug A bug in TypeScript Fixed A PR has been merged for this issue labels Feb 17, 2016
@paulvanbrenk paulvanbrenk added this to the TypeScript 1.8.2 milestone Feb 17, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants