2

I am building a Continuous Integration and Deployment steps on VS online team services. This is an asp.net core project which is using web-compiler to compile sass/scss files and then BundlerMinifier to bundle and minify files.

I have found this question, BundlerMinifier and WebCompiler does not output files on build on stackoverflow. This is my original problem

On the build log, I've found the following message

2017-08-03T15:02:26.7240383Z [33m[1m wwwroot/css/comsite.css was not found[0m[39m[49m

There is a scss file that generates comsite.css file of 1143 lines. but there are some calculation going on the files, so i guess this is taking some time. So my understanding is bundler is running before web-compiler generate the file. So, i tried to run compilerconfig.json before build and bundlerconfig.json after build. it didn't help. Now, I am trying to run both after build, please check the image below

TaskRunner on vs2017

The problem is I could not move the compilerconfig up before bundler. So, my question is there any way to run compiler before bundler from task runner?

Updated

As stated in the comment bundleconfig.json

[
  {
    "outputFileName": "wwwroot/css/bootstrap337.min.css",
    "inputFiles": [
      "wwwroot/lib/bootstrap/dist/css/bootstrap.css"
    ]
  },
  {
    "outputFileName": "wwwroot/css/site.min.css",
    "inputFiles": [
      "wwwroot/css/site.css"
    ]
  },
  {
    "outputFileName": "wwwroot/js/site.min.js",
    "inputFiles": [
      "wwwroot/js/site.js"
    ],
    "minify": {
      "enabled": true,
      "renameLocals": true
    }
  },
  {
    "outputFileName": "wwwroot/css/metro-all.min.css",
    "inputFiles": [
      "wwwroot/css/metro.css",
      "wwwroot/css/metro-responsive.css",
      "wwwroot/css/metro-helper.css",
      "wwwroot/css/metro-icons.css"
    ]
  },
  {
    "outputFileName": "wwwroot/js/metro-base.min.js",
    "inputFiles": [
      "wwwroot/js/metro-base.js"
    ]
  }
]

compilerconfig.json

[
  {
    "outputFile": "wwwroot/css/site.css",
    "inputFile": "wwwroot/scss/site.scss"
  },
  {
    "outputFile": "wwwroot/scss/main.css",
    "inputFile": "wwwroot/scss/main.scss"
  },
  {
    "outputFile": "wwwroot/scss/default.css",
    "inputFile": "wwwroot/scss/default.scss"
  }
]

And the build log for the web project

[command]"C:\Program Files\dotnet\dotnet.exe" build d:\a\1\s\src\SY.Manager\SY.Manager.csproj --configuration release /maxcpucount:3 2017-08-03T12:36:17.3376673Z Microsoft (R) Build Engine version 15.1.1012.6693 2017-08-03T12:36:17.3426644Z Copyright (C) Microsoft Corporation. All rights reserved. 2017-08-03T12:36:17.3426644Z 2017-08-03T12:36:18.3840789Z
2017-08-03T12:36:18.3840789Z Bundler: Begin processing bundleconfig.json 2017-08-03T12:36:18.7668697Z Minified wwwroot/css/bootstrap337.min.css 2017-08-03T12:36:18.7678702Z [33m[1m wwwroot/css/site.css was not found[0m[39m[49m 2017-08-03T12:36:19.2716108Z Minified wwwroot/js/site.min.js 2017-08-03T12:36:21.9055182Z Minified wwwroot/css/metro-all.min.css 2017-08-03T12:36:21.9095163Z Bundler: Done processing bundleconfig.json 2017-08-03T12:36:25.4501457Z BS.Data -> d:\a\1\s\src\BS.Data\bin\release\netcoreapp1.1\BS.Data.dll 2017-08-03T12:36:27.4295141Z BS.Domain -> d:\a\1\s\src\BS.Domain\bin\release\netcoreapp1.1\BS.Domain.dll 22017-08-03T12:36:36.2084047Z Controllers\ApiResourcesController.cs(308,42): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [d:\a\1\s\src\SY.Manager\SY.Manager.csproj]

2017-08-03T12:36:36.2084047Z Controllers\RolesController.cs(184,73): warning CS0618: 'ApplicationRole.RoleName' is obsolete: 'Duplicate field. Please use the Name field instead.' [d:\a\1\s\src\SY.Manager\SY.Manager.csproj]

2017-08-03T12:36:36.4348318Z SY.Manager -> d:\a\1\s\src\SY.Manager\bin\release\netcoreapp1.1\SY.Manager.dll 2017-08-03T12:36:42.5313140Z Razor view compilation for SY.Manager -> bin\release\netcoreapp1.1\SY.Manager.PrecompiledViews.dll 2017-08-03T12:36:42.5413146Z 2017-08-03T12:36:42.5413146Z Build succeeded. 2017-08-03T12:36:42.5413146Z 2017-08-03T12:36:42.5413146Z Controllers\ApiResourcesController.cs(150,42): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [d:\a\1\s\src\SY.Manager\SY.Manager.csproj] 2017-08-03T12:36:42.5423139Z 6 Warning(s) 2017-08-03T12:36:42.5423139Z 0 Error(s) 2017-08-03T12:36:42.5423139Z 2017-08-03T12:36:42.5423139Z Time Elapsed 00:00:25.12

Updated Build log

Please find the log below which was created by VSOnline Build Solution task. I have added the log for full project, but remove some details to make it as short as possible

2017-08-18T09:14:15.9528421Z Project "d:\a\1\s\SY.sln" (1) is building "d:\a\1\s\test\SY.ManagerTests\SY.ManagerTests.csproj" (11) on node 1 (default targets). 2017-08-18T09:14:15.9539325Z PrepareForBuild: 2017-08-18T09:14:15.9539325Z Creating directory "bin\Release\netcoreapp1.1\". 2017-08-18T09:14:15.9539325Z Creating directory "obj\Release\netcoreapp1.1\". 2017-08-18T09:14:17.9102914Z Project "d:\a\1\s\test\SY.ManagerTests\SY.ManagerTests.csproj" (11) is building "d:\a\1\s\src\SY.Manager\SY.Manager.csproj" (12:2) on node 1 (default targets). 2017-08-18T09:14:17.9102914Z BundleMinify: 2017-08-18T09:14:17.9102914Z 2017-08-18T09:14:17.9102914Z
Bundler: Begin processing bundleconfig.json 2017-08-18T09:14:17.9733689Z Minified wwwroot/css/bootstrap337.min.css 2017-08-18T09:14:17.9743707Z [33m[1m wwwroot/css/site.css was not found[0m[39m[49m 2017-08-18T09:14:18.2918725Z Minified wwwroot/js/site.min.js 2017-08-18T09:14:21.9681289Z Minified wwwroot/css/metro-all.min.css 2017-08-18T09:14:21.9781425Z Minified wwwroot/js/metro-base.min.js 2017-08-18T09:14:21.9781425Z Bundler: Done processing bundleconfig.json 2017-08-18T09:14:21.9831479Z PrepareForBuild: 2017-08-18T09:14:21.9831479Z Creating directory "bin\Release\netcoreapp1.1\". 2017-08-18T09:14:21.9831479Z Creating directory "obj\Release\netcoreapp1.1\". 2017-08-18T09:14:24.6830316Z PreComputeCompileTypeScript: 2017-08-18T09:14:24.6830316Z C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.2\tsc.exe --noEmitOnError --listEmittedFiles 2017-08-18T09:14:24.6840303Z CompileTypeScript: 2017-08-18T09:14:24.6840303Z C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.2\tsc.exe --noEmitOnError --listEmittedFiles 2017-08-18T09:14:24.6850285Z GenerateTargetFrameworkMonikerAttribute: 2017-08-18T09:14:24.6850285Z Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files. 2017-08-18T09:14:24.7019946Z CoreCompile: 2017-08-18T09:14:24.7089830Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1705 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;RELEASE;NETCOREAPP1_1 /reference:C:\Users\buildguest.nuget\packages\automapper\6.1.1\lib\netstandard1.3\AutoMapper.dll {other nuget packages}... /reference:C:\Users\buildguest.nuget\packages\wiry.base32.patched\1.0.5.1\lib\netstandard1.1\Wiry.Base32.dll /debug- /debug:portable /filealign:512 /nologo /optimize+ /out:obj\Release\netcoreapp1.1\SY.Manager.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Static Analysis Tools\Rule Sets\MinimumRecommendedRules.ruleset" /target:exe /warnaserror- /utf8output /deterministic+ /analyzer:C:\Users\buildguest.nuget\packages\microsoft.codeanalysis.analyzers\1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll /analyzer:C:\Users\buildguest.nuget\packages\microsoft.codeanalysis.analyzers\1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll

Controllers\ApiController.cs {other controllers}.... Models\ApiViewModels\CreateApiViewModel.cs {other viewmodel}...

Program.cs Startup.cs Utility\Notify.cs ViewComponents\HostListViewComponent.cs "d:\a_temp.NETCoreApp,Version=v1.1.AssemblyAttributes.cs" obj\Release\netcoreapp1.1\SY.Manager.AssemblyInfo.cs 2017-08-18T09:14:24.7139726Z Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn

2017-08-18T09:14:25.4616323Z _CopyFilesMarkedCopyLocal: 2017-08-18T09:14:25.4616323Z Copying file from "d:\a\1\s\src\SY.Data\bin\Release\netcoreapp1.1\SY.Data.dll" to "bin\Release\netcoreapp1.1\SY.Data.dll". 2017-08-18T09:14:25.4626294Z Copying file from "d:\a\1\s\src\SY.Data\bin\Release\netcoreapp1.1\SY.Data.pdb" to "bin\Release\netcoreapp1.1\SY.Data.pdb". 2017-08-18T09:14:25.4626294Z GetTypeScriptCopyToOutputDirectoryItems: 2017-08-18T09:14:25.4626294Z Adding items with BuildAction=TypeScriptCompile to the same collections that will be populated (with items of other BuildActions) by the GetCopyToOutputDirectoryItems target 2017-08-18T09:14:25.4875852Z _CopyOutOfDateSourceItemsToOutputDirectoryAlways: 2017-08-18T09:14:25.4885844Z Copying file from "d:\a\1\s\src\SY.Data\appsettings.json" to "bin\Release\netcoreapp1.1\appsettings.json". 2017-08-18T09:14:25.4895830Z Copying file from "d:\a\1\s\src\SY.Manager\appsettings.json" to "bin\Release\netcoreapp1.1\appsettings.json". 2017-08-18T09:14:25.5135405Z CopyFilesToOutputDirectory: 2017-08-18T09:14:25.5135405Z Copying file from "obj\Release\netcoreapp1.1\SY.Manager.dll" to "bin\Release\netcoreapp1.1\SY.Manager.dll". 2017-08-18T09:14:25.5145385Z SY.Manager -> d:\a\1\s\src\SY.Manager\bin\Release\netcoreapp1.1\SY.Manager.dll 2017-08-18T09:14:25.5145385Z Copying file from "obj\Release\netcoreapp1.1\SY.Manager.pdb" to "bin\Release\netcoreapp1.1\SY.Manager.pdb". 2017-08-18T09:14:25.5454915Z MvcRazorPrecompile: 2017-08-18T09:14:25.5454915Z dotnet exec --runtimeconfig "d:\a\1\s\src\SY.Manager\bin\Release\netcoreapp1.1\SY.Manager.runtimeconfig.json" --depsfile "d:\a\1\s\src\SY.Manager\bin\Release\netcoreapp1.1\SY.Manager.deps.json" "C:\Users\buildguest.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\1.1.1\build\netcoreapp1.1../../lib/netcoreapp1.1/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj\Release\netcoreapp1.1\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp" 2017-08-18T09:14:32.3099160Z Razor view compilation for SY.Manager -> bin\Release\netcoreapp1.1\SY.Manager.PrecompiledViews.dll 2017-08-18T09:14:32.3109135Z Done Building Project "d:\a\1\s\src\SY.Manager\SY.Manager.csproj" (default targets).

Here the bundler finds the css file but could not see anything from web-compiler that compile scss to css

MJK
  • 3,434
  • 3
  • 32
  • 55
  • Could you reproduce this issue with a new project? Could you share the detail build log here? Run compilerconfig.json before build and bundlerconfig.json after build work for me. – starian chen-MSFT Aug 04 '17 at 05:54
  • @starain-MSFT Not really, other projects do not have this issue. If i just add part of the build log will it help? – MJK Aug 05 '17 at 15:21
  • So, just this project has the issue? You can post Get source and Build log here. Also, post the code of bundleconfig.json and compilerconfig.json. – starian chen-MSFT Aug 07 '17 at 01:39
  • I guess, the issue is related to [this issue](https://github.com/dotnet/cli/issues/5457) – MJK Aug 07 '17 at 15:58
  • Your issue related to the source files that generated through compiler that is not related to that issue. Could you post the detail build log, bundleconfig.json and compilerconfig.json here? – starian chen-MSFT Aug 08 '17 at 01:50
  • @starain-MSFT I have added those details on the question – MJK Aug 09 '17 at 15:45
  • Try to use Visual Studio Build task and check the result. – starian chen-MSFT Aug 10 '17 at 03:20
  • @starain-MSFT locally it works fine. there are no issue on local build – MJK Aug 11 '17 at 14:45
  • I mean using Visual Studio Build task instead in build definition. – starian chen-MSFT Aug 14 '17 at 01:46
  • @starain-MSFT, the log has been added. I guess by mentioning "Visual Studio Build task" you mean "Build solution **\*.sln" – MJK Aug 16 '17 at 11:19
  • Based on the log, there isn't warning/error and wwwroot/css/site.min.css has been minified, Does the issue have been solved? – starian chen-MSFT Aug 17 '17 at 01:34
  • @starain-MSFT you are right, to work around the issue one of my colleague just add the generated css file in the source control. For this readon, there are no errors in the log. I will try to reproduce the issue and will post the build task log – MJK Aug 17 '17 at 15:59
  • You can try to re-create compilerconfig file. – starian chen-MSFT Aug 18 '17 at 01:35
  • @starain-MSFT thanks for staying with me. I have updated the post with new build task log, please check again. Any help would be highly appreciated – MJK Aug 18 '17 at 09:44
  • Did you re-create compilerconfig file through VS? – starian chen-MSFT Aug 21 '17 at 01:35
  • @starain-MSFT what do you mean by re-create? – MJK Aug 21 '17 at 09:29
  • Delete compilerconfig.json file, then right click a file > Web Compiler >Compile file, right-click the compilerconfig.json >Enable Compile on build, in Task Runner Explorer >compilerconfig.json> All files> Bindings> Before Build. – starian chen-MSFT Aug 21 '17 at 09:38

0 Answers0