Tooling: ASP.NET Core publish failed due to a false positive in Microsoft.DotNet.Publishing.targets

Created on 27 May 2016  Â·  5Comments  Â·  Source: aspnet/Tooling

Steps to reproduce

  • Setup a ASP.NET Core project with Visual Studio 2015
  • Configure it to WebDeploy it to a remote machine with IIS.
  • Deploy it in release mode

    Expected behavior

The project is deployed without errors.

Actual behavior

Some MSBuild tasks (gifsicle, jpegtran, optipng ...), that are ok, are detected as an error by MSBuild.

Environment data

As you can see in the output, MSBuild detects a false positive executing some tasks:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing.targets(154,5): Error : √ gifsicle pre-build test passed successfully

This is the complete log:

1>------ Publish started: Project: semanticmerge, Configuration: Release Any CPU ------
rmdir /S /Q "C:\Users\danipen.CODICE\AppData\Local\Temp\PublishTemp\semanticmerge100\"
Environment variables:
Path=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
C:\Program Files\dotnet\dotnet.exe publish "C:\downloadswebapp\01applications\semanticmerge.com\SemanticPublic\semanticmerge" --framework netcoreapp1.0 --output "C:\Users\danipen.CODICE\AppData\Local\Temp\PublishTemp\semanticmerge100" --configuration Release --no-build
Publishing semanticmerge for .NETCoreApp,Version=v1.0
> [email protected] postinstall C:\downloadswebapp\01applications\semanticmerge.com\SemanticPublic\semanticmerge\node_modules\gifsicle
> node lib/install.js
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing.targets(154,5): Error :   √ gifsicle pre-build test passed successfully
> [email protected] postinstall C:\downloadswebapp\01applications\semanticmerge.com\SemanticPublic\semanticmerge\node_modules\jpegtran-bin
> node lib/install.js
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing.targets(154,5): Error :   √ jpegtran pre-build test passed successfully
npm WARN prefer global [email protected] should be installed with -g
> [email protected] install C:\downloadswebapp\01applications\semanticmerge.com\SemanticPublic\semanticmerge\node_modules\node-sass
> node scripts/install.js
> [email protected] postinstall C:\downloadswebapp\01applications\semanticmerge.com\SemanticPublic\semanticmerge\node_modules\node-sass
> node scripts/build.js
"C:\downloadswebapp\01applications\semanticmerge.com\SemanticPublic\semanticmerge\node_modules\node-sass\vendor\win32-ia32-47\binding.node" exists. 
 testing binary.
Binary is fine; exiting.
> [email protected] postinstall C:\downloadswebapp\01applications\semanticmerge.com\SemanticPublic\semanticmerge\node_modules\optipng-bin
> node lib/install.js
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing.targets(154,5): Error :   √ optipng pre-build test passed successfully
TFS Tracked

Most helpful comment

TFS: 225787
I've added this to our internal TFS, we will reply back here soon.

All 5 comments

Copied from dotnet/cli#3251 for @danipen

TFS: 225787
I've added this to our internal TFS, we will reply back here soon.

Looks similar to this issue: https://github.com/aspnet/dnx/issues/2017

When you execute this command , can you confirm whether the log is getting written to the StandardOut or StandardError? If it is standardError, then that is the rootcause and needs to be fixed by the tool that writes it to error.

C:\Program Files\dotnet\dotnet.exe publish "C:\downloadswebapp\01applications\semanticmerge.com\SemanticPublic\semanticmerge" --framework netcoreapp1.0 --output "C:\Users\danipen.CODICEAppData\Local\Temp\PublishTemp\semanticmerge100" --configuration Release --no-build

Hi @vijayrkn you're right. When I redirect the error output to a file, those messages are present in the error outptu file:

npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] string_decoder is also the name of a node core module.
  √ gifsicle pre-build test passed successfully
  √ jpegtran pre-build test passed successfully
npm WARN prefer global [email protected] should be installed with -g
  √ optipng pre-build test passed successfully

So the problem seems to be in the dotnet.exe publish command.

Closing per the comments on @danipen , re-opened dotnet/cli#3251

Was this page helpful?
0 / 5 - 0 ratings