TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

TypeScript v1.7 MSBuild tooling breaks web application publish

Open mattbrooks2010 opened this issue 11 years ago • 48 comments

Summary

Installing TypeScript 1.7 tooling for Visual Studio causes different behaviour from 1.6 when publishing web applications, both from within Visual Studio (right click > publish) and via msbuild.exe (/p:DeployOnBuild=true).

This issue has only been observed using a file system publish.

Symptoms

Generated JavaScript is no longer included in the packaged / published output.

Observations

It appears there is a difference in the MSBuild Content ItemGroup's metadata. I believe that previously the generated JavaScript files were being included in the Content ItemGroup as paths relative to the .csproj file:

Scripts\App.js    

As of 1.7 it appears the generated JavaScript files are now being included in Content as absolute paths:

C:\Projects\Solution\Web\Scripts\App.js

Perhaps this is causing a problem for the web publishing mechanism?

mattbrooks2010 avatar Dec 02 '15 17:12 mattbrooks2010

@paulvanbrenk right! So, why is this an Azure publishing issue, making the timeline for a fix uncertain?

mattbrooks2010 avatar Dec 03 '15 22:12 mattbrooks2010

The Azure publishing is a different issue, but touches similar code paths; we need to make sure all publishing scenarios work. And we prefer to publish a single new installer which fixes both issues.

paulvanbrenk avatar Dec 03 '15 22:12 paulvanbrenk

OK thank you for the clarity.

mattbrooks2010 avatar Dec 03 '15 22:12 mattbrooks2010

I can confirm this is happening with an installation of VS 2015 update 1. We have a build machine that has TFS 2015 update 1 on and VS 2015 update 1 on it. This machine used to have just the RTM versions of both. After updating, the same errors occur, but our build machine says the specific error is something like "the path is not supported" I'll update with the log using the /v:diagnostic like you were describing above. If I do that does it just add more to the log file that I just need to paste in here? which part are you specifically looking for?

it gave up on doing the rest after one or two of the files failed. It does as you described, it adds the full path rather than the relative one twice and I get the error of "The given path's format is not supported."

Please let me know where to find this extra diagnostic log info and provide it. We have CI builds on almost all of our projects, and right now only the ones with typescript are failing. so, while it could be related to web publishing, I think it could just be the typescript builder too.

brentlyjdavid avatar Dec 04 '15 13:12 brentlyjdavid

I am having the same issue. TFS is 2013 on premise and the build machine is running VS 2015 Update 1.

I have turn on the flags you mentioned and attached the build output. Let me know if there is something else you need.

BHP.txt

pmiddleton avatar Dec 04 '15 16:12 pmiddleton

Thanks @pmiddleton that file was useful.

paulvanbrenk avatar Dec 04 '15 23:12 paulvanbrenk

My team hit the Azure version of this issue. We worked around it by manually adding ContinueOnError="WarnAndContinue" to the Copy task within the CopyWebRoleFiles target, within Microsoft.WindowsAzure.targets. The compiled .js files are still copied, possibly via some other mechanism. There are a lot of warnings, but at least the Azure publishes work.

JamesDSch avatar Dec 06 '15 01:12 JamesDSch

After installing VS 2015 Update 1, we are hitting this issue as well.

This is urgent for us, because it's blocking us from publishing to our Azure cloud service.

The error we get is "Unable to copy file [path to .js file generated from .ts] to file [new file incorrect file path, incorrect due to duplicate absolute path]. The given path's format is not supported.

JudahGabriel avatar Dec 07 '15 17:12 JudahGabriel

We have the Azure publish issue as well. Same scenario. Workaround mentioned above does not fix for us, and we still cannot publish. SO here: http://stackoverflow.com/questions/34100740/error-copying-typescript-files-after-packaging-azure-project-visual-studio-201

PageEngine avatar Dec 07 '15 17:12 PageEngine

Figured out what's happening, when you specify $(OutDir) in your project, which generally only happens on build servers, a different code path gets executed for copy-ing files to the final location. I have a fix for this checked in, which we're working on to get into your hands for validation.

Thanks for all the logs and feedback!

paulvanbrenk avatar Dec 07 '15 22:12 paulvanbrenk

I don't have an $(OutDir) specified in my web project. However I am still running into this error when I try to publish the cloud project which references the web project. There are no build servers involved. This is all on the local dev box.

Using mattbrooks2010 workaround of reverting to the TypeScript.tasks.dll which shipped with Typescript 1.6 fixes this for me.

gaziqbal avatar Dec 07 '15 23:12 gaziqbal

@gaziqbal Looks like cloud projects specify the $(OutDir) in their build, I don't have any issues building/publishing those with my fixes.

paulvanbrenk avatar Dec 07 '15 23:12 paulvanbrenk

Just a further reference point: we have the same symptom as @gaziqbal. No build server, all on a single dev machine, web project without $(OutDir), compiles fine but fails when we try to package an Azure cloud service which references the web project.

PageEngine avatar Dec 07 '15 23:12 PageEngine

Having same issues but I reported on msbuild repo (see above) with csproj code. Looking forward to a resolution.

nicholashead avatar Dec 08 '15 05:12 nicholashead

I am having this same issue, when it comes time to copy files to to the _PublishedWebsites\app\ folder (as defined in the Microsoft.WebApplication.targets file, Target Name="_CopyWebApplicationLegacy") it has the absolute path twice (eg C:\Builds\1\App_PublishedWebsites\C:\Builds\1\App\Scripts\SomeScript.js).

It is a problem with the TypeScript.Tasks.dll. I copied back the 1.6 version and now our automated builds work again.

KentSwan avatar Dec 09 '15 20:12 KentSwan

We think we have a fix for this.

@KentSwan, @nicholashead, @PageEngine, @gaziqbal, @JudahGabriel, @JamesDSch, @pmiddleton, @mattbrooks2010 , @brentdavid2008 @JiriZidek, and @mdsharpe -- Can you try VS 2015 TS 1.7.6 Update or VS 2013 1.7.5 Update and let us know if it solves the issue?

mhegazy avatar Dec 11 '15 00:12 mhegazy

@mhegazy Just tried for VS2015 and our Azure cloud service publish worked fine; we're back in business! Thanks for fixing this prior to the next scheduled release.

JamesDSch avatar Dec 11 '15 01:12 JamesDSch

This works for us too. TFS 2015 update 1 Xaml Builds normal web publishing - non Azure. Thanks!

brentlyjdavid avatar Dec 11 '15 01:12 brentlyjdavid

@mhegazy Thank you, my azure web project published after the installation of the update.

ckapatch avatar Dec 11 '15 02:12 ckapatch

@mhegazy Fixed here as well on VS 2015 (did not test VS 2013), packaging for an Azure cloud service. Have answered my SO question with links to the downloads here http://stackoverflow.com/questions/34100740/error-copying-typescript-files-when-packaging-azure-project-visual-studio-2015. Thanks for the quick fix.

PageEngine avatar Dec 11 '15 03:12 PageEngine