Open wangkanai opened 6 years ago
After add reference like #321 to
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.5.180" />
does not help with
resolving the issue.
So I now not even sure if it the project structure.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Properties\PublishProfiles\**" />
<Content Remove="Properties\PublishProfiles\**" />
<EmbeddedResource Remove="Properties\PublishProfiles\**" />
<None Remove="Properties\PublishProfiles\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BuildBundlerMinifier" Version="2.6.362" />
<PackageReference Include="BuildWebCompiler" Version="1.11.326" />
<PackageReference Include="HtmlAgilityPack" Version="1.6.0" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.5.180" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.6.362" />
</ItemGroup>
<ItemGroup>
<Folder Include="Pages\About\" />
<Folder Include="Pages\Legal\" />
<Folder Include="Pages\Investors\" />
<Folder Include="Pages\Feedback\" />
<Folder Include="Pages\Events\" />
<Folder Include="Pages\News\" />
</ItemGroup>
</Project>
Microsoft.Build.Utilities.Core
2018-01-24T06:53:27.8059496Z ##[section]Starting: Build
2018-01-24T06:53:27.8068306Z ==============================================================================
2018-01-24T06:53:27.8068511Z Task : .NET Core
2018-01-24T06:53:27.8068742Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
2018-01-24T06:53:27.8069013Z Version : 2.1.9
2018-01-24T06:53:27.8069160Z Author : Microsoft Corporation
2018-01-24T06:53:27.8069399Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2018-01-24T06:53:27.8069623Z ==============================================================================
2018-01-24T06:53:28.9750341Z [command]"C:\Program Files\dotnet\dotnet.exe" build d:\a\3\s\RiverSync\RiverSync.csproj --configuration release
2018-01-24T06:53:29.3750691Z Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core
2018-01-24T06:53:29.3754921Z Copyright (C) Microsoft Corporation. All rights reserved.
2018-01-24T06:53:29.3755302Z
2018-01-24T06:53:31.8691880Z Restoring packages for d:\a\3\s\RiverSync\RiverSync.csproj...
2018-01-24T06:53:31.8692830Z Restoring packages for d:\a\3\s\RiverSync\RiverSync.csproj...
2018-01-24T06:53:31.8699465Z Restore completed in 972.99 ms for d:\a\3\s\RiverSync\RiverSync.csproj.
2018-01-24T06:53:31.8703741Z Restoring packages for d:\a\3\s\RiverSync\RiverSync.csproj...
2018-01-24T06:53:32.1935870Z Generating MSBuild file d:\a\3\s\RiverSync\obj\RiverSync.csproj.nuget.g.props.
2018-01-24T06:53:32.2410558Z Restore completed in 1.25 sec for d:\a\3\s\RiverSync\RiverSync.csproj.
2018-01-24T06:53:32.6282505Z Restore completed in 744.53 ms for d:\a\3\s\RiverSync\RiverSync.csproj.
2018-01-24T06:53:33.2943920Z C:\Users\VssAdministrator\.nuget\packages\buildwebcompiler\1.11.326\build\BuildWebCompiler.targets(15,9): error MSB4062: The "WebCompiler.CompilerBuildTask" task could not be loaded from the assembly C:\Users\VssAdministrator\.nuget\packages\buildwebcompiler\1.11.326\build\..\tools\WebCompiler.exe. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [d:\a\3\s\RiverSync\RiverSync.csproj]
2018-01-24T06:53:33.2987760Z
2018-01-24T06:53:33.2988112Z Build FAILED.
2018-01-24T06:53:33.2988241Z
2018-01-24T06:53:33.2988769Z C:\Users\VssAdministrator\.nuget\packages\buildwebcompiler\1.11.326\build\BuildWebCompiler.targets(15,9): error MSB4062: The "WebCompiler.CompilerBuildTask" task could not be loaded from the assembly C:\Users\VssAdministrator\.nuget\packages\buildwebcompiler\1.11.326\build\..\tools\WebCompiler.exe. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [d:\a\3\s\RiverSync\RiverSync.csproj]
2018-01-24T06:53:33.2989286Z 0 Warning(s)
2018-01-24T06:53:33.2989740Z 1 Error(s)
2018-01-24T06:53:33.2989843Z
2018-01-24T06:53:33.2989987Z Time Elapsed 00:00:03.80
2018-01-24T06:53:33.3505198Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
2018-01-24T06:53:33.3506329Z ##[error]Dotnet command failed with non-zero exit code on the following projects : d:\a\3\s\RiverSync\RiverSync.csproj
201
Also clean up dotnet cli tool reference
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.6.15" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.5.180" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.5.180" PrivateAssets="All" />
<PackageReference Include="BuildBundlerMinifier" Version="2.6.362" />
<PackageReference Include="BuildWebCompiler" Version="1.11.375" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
2018-01-24T07:55:03.5173813Z ##[section]Starting: Build
2018-01-24T07:55:03.5183394Z ==============================================================================
2018-01-24T07:55:03.5183621Z Task : .NET Core
2018-01-24T07:55:03.5183868Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
2018-01-24T07:55:03.5184130Z Version : 2.1.9
2018-01-24T07:55:03.5184297Z Author : Microsoft Corporation
2018-01-24T07:55:03.5184567Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2018-01-24T07:55:03.5184793Z ==============================================================================
2018-01-24T07:55:04.7024519Z [command]"C:\Program Files\dotnet\dotnet.exe" build d:\a\3\s\RiverSync\RiverSync.csproj --configuration release
2018-01-24T07:55:05.0352386Z Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core
2018-01-24T07:55:05.0354242Z Copyright (C) Microsoft Corporation. All rights reserved.
2018-01-24T07:55:05.0355053Z
2018-01-24T07:55:06.7338702Z Restoring packages for d:\a\3\s\RiverSync\RiverSync.csproj...
2018-01-24T07:55:06.7339732Z Restoring packages for d:\a\3\s\RiverSync\RiverSync.csproj...
2018-01-24T07:55:08.1782767Z Generating MSBuild file d:\a\3\s\RiverSync\obj\RiverSync.csproj.nuget.g.props.
2018-01-24T07:55:08.1783741Z Restore completed in 1.31 sec for d:\a\3\s\RiverSync\RiverSync.csproj.
2018-01-24T07:55:08.5511806Z Restore completed in 1.87 sec for d:\a\3\s\RiverSync\RiverSync.csproj.
2018-01-24T07:55:40.2134365Z
2018-01-24T07:55:40.2135248Z WebCompiler: Begin compiling compilerconfig.json
2018-01-24T07:55:40.7141663Z WebCompiler installing updated versions of the compilers...
2018-01-24T07:55:50.9323944Z Compiled wwwroot/scss/riversync.css
2018-01-24T07:55:51.5944018Z Minified wwwroot/scss/riversync.min.css
2018-01-24T07:55:51.5944686Z WebCompiler: Done compiling compilerconfig.json
2018-01-24T07:55:51.5945394Z
2018-01-24T07:55:51.5945768Z Bundler: Begin processing bundleconfig.json
2018-01-24T07:55:51.6535608Z Minified wwwroot/css/site.min.css
2018-01-24T07:55:51.6536306Z Bundler: Done processing bundleconfig.json
2018-01-24T07:56:04.2846322Z RiverSync -> d:\a\3\s\RiverSync\bin\release\netcoreapp2.0\RiverSync.dll
2018-01-24T07:56:04.2847027Z
2018-01-24T07:56:04.2847425Z Build succeeded.
2018-01-24T07:56:04.2847757Z 0 Warning(s)
2018-01-24T07:56:04.2848105Z 0 Error(s)
2018-01-24T07:56:04.2848345Z
2018-01-24T07:56:04.2848669Z Time Elapsed 00:00:59.13
2018-01-24T07:56:04.3934215Z ##[section]Finishing: Build
I'm still having this issue now using the latest DotNet SDK 2.1
root@2aa5d1e4275a:/repo/AppPath# dotnet build
Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 49.56 ms for /repo/AppPath/Application.csproj.
Restoring packages for /repo/AppPath/Application.csproj...
//.. Various package installs
Generating MSBuild file /repo/AppPath/obj/Application.csproj.nuget.g.props.
Generating MSBuild file /repo/AppPath/obj/Application.csproj.nuget.g.targets.
Restore completed in 8.74 sec for /repo/AppPath/Application.csproj.
WebCompiler: Begin compiling compilerconfig.json
WebCompiler installing updated versions of the compilers...
/root/.nuget/packages/buildwebcompiler/1.11.375/build/BuildWebCompiler.targets(12,9): error : No such file or directory [/repo/AppPath/Application.csproj]
Build FAILED.
/root/.nuget/packages/buildwebcompiler/1.11.375/build/BuildWebCompiler.targets(12,9): error : No such file or directory [/repo/AppPath/Application.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:10.91
CSProj as Follows:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.6.15" />
<PackageReference Include="Microsoft.Build.Framework" Version="15.5.180" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.5.180" PrivateAssets="All" />
<PackageReference Include="BuildBundlerMinifier" Version="2.6.362" />
<PackageReference Include="BuildWebCompiler" Version="1.11.375" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\images\" />
<Folder Include="wwwroot\lib\bootstrap\" />
<Folder Include="wwwroot\lib\superfish\" />
<Folder Include="wwwroot\fonts\" />
</ItemGroup>
</Project>
Has anyone found a solution/can advise me on a fix for this issue?
Having this issue with the dotnet sdk 2.2 too. Software is being built in a docker container.
WebCompiler: Begin compiling compilerconfig.json
WebCompiler installing updated versions of the compilers...
/root/.nuget/packages/buildwebcompiler/1.12.394/build/BuildWebCompiler.targets(12,9): error : No such file or directory [/app/Wex.Web/Wex.Web.fsproj]
The command '/bin/sh -c dotnet publish -c Release -o out' returned a non-zero code: 1
ERROR: Job failed: exit code 1
Same problem as above (see comment by @ajuch)
What can I do to help to troubleshoot the issue?
By the way, if I do export MSBUILDDISABLENODEREUSE=0
then the problem symptom is
/root/.nuget/packages/buildwebcompiler/1.12.394/build/BuildWebCompiler.targets(12,9): error : MSB0001: Internal MSBuild Error: ContextID 72 should have been in the ID-to-project file mapping but wasn't! [/app/src/a/a.csproj]
Some info:
I think the problem might be at CompilerServices.cs Line 81. On Linux the nodejs binary doesn't have the .exe suffix, so WebCompiler tries to install it, which won't work on linux?
@ajuch this would be true for 7zip as well.
and also
ProcessStartInfo start = new ProcessStartInfo { WorkingDirectory = _path, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, FileName = "cmd.exe", Arguments = "/c prepare.cmd" };
would never work on linux for obvious reasons. Looks like windows specific code
It looks like exception is going to be thrown and bubble up all the way to the main and then get lost without being logget See ConfigFileProcessor.Process and the chain. I don't understand how loggint works in this code , I will try to instrument the code and try to run it in docker
after instrumenting the code the following is the exception stack System.ComponentModel.Win32Exception (2): No such file or directory at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at WebCompiler.CompilerService.Initialize() at WebCompiler.CompilerService.GetCompiler(Config config) at WebCompiler.ConfigFileProcessor.ProcessConfig(String baseFolder, Config config) at WebCompiler.ConfigFileProcessor.Process(String configFile, IEnumerable`1 configs, Boolean force) at WebCompiler.Program.Main(String[] args)
I tend to think, that my assumption was correct and WebCompiler, is not yet targeting Linux environments
I'm still experiencing this issue. Was there any true resolution/roadmap for a fix?
@JonnyBooker this isn't quite a solution, but a workaround I've found is that you can target the package to only build on a Windows environment by modifying your csproj to
<PackageReference Condition="'$(OS)' == 'Windows_NT'" Include="BuildWebCompiler" Version="1.12.394" />
Unfortunately you still have to build and compile on Windows at some point, but this should grease the VSTS build along. In my case I just locally compile (using SASS compiler) and version control the output
@yjmrobert Adding the packageReference has build sucessfully in Azure DevOps. But the published website has some missing sass/less functionality which is working in Visual Studios.
@yjmrobert How to do this " locally compile (using SASS compiler) and version control the output"
@dkadd I publish the compiled output style.min.css
and have the WebCompiler extension set up to re-compile that file every time I make a change and save.
Same problem on Azure DevOps Ubuntu build agent.
Same on Ubuntu Github Pages
I got the same problem with a Jenkins Pipeline running on a Windows 10 VM. No solution found apart from including my css file in de repository...
I have the same problem. No way to build in Linux?
Can somebody please suggest an alternative to using the WebCompiler extension? I'm not sure which tools to use or how to include that solution into the build. Thanks!
See https://github.com/madskristensen/WebCompiler/issues/468 for alternatives.
Hi @madskristensen Could you have look please
I enable compile on build as seen in the picture below. My scss got compile nicely. Then when i check in the code to source control for DevOps continuous deployment and the build failed.
How do fix this problem for CI in VSTS to work nicely with Web Compiler?
Thank you very much.
VSTS build logs .NET Core build definition 2.x
VSTS build logs .NET Core build definition 1.x
First I think its was the preview build definition of 2.x, so I tried changing to 1.x and still got the same result.