madskristensen / BundlerMinifier

Visual Studio extension
Other
611 stars 171 forks source link

Unable to run dotnet bundle under Azure Devops for .NET Core 3.0 #453

Open bartekkois opened 4 years ago

bartekkois commented 4 years ago

Installed product versions

Description

After migrating web app to .NET Core 3.0 and BundlerMinifier.Core to 3.2.435 dotnet bundle under Azure Devops crashes with the following error:

Task         : .NET Core
Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
Version      : 2.158.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
==============================================================================
[command]/opt/hostedtoolcache/dotnet/dotnet publish /home/vsts/work/1/s/src/GPONMonitor/GPONMonitor.csproj --configuration Release --output /home/vsts/work/1/a/GPONMonitor
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 17.96 ms for /home/vsts/work/1/s/src/GPONMonitor/GPONMonitor.csproj.
  Restore completed in 37.9 ms for /home/vsts/work/1/s/src/GPONMonitor/GPONMonitor.csproj.
  Restore completed in 39.52 ms for /home/vsts/work/1/s/src/GPONMonitor/GPONMonitor.csproj.
  GPONMonitor -> /home/vsts/work/1/s/src/GPONMonitor/bin/Release/netcoreapp3.0/GPONMonitor.dll
  GPONMonitor -> /home/vsts/work/1/s/src/GPONMonitor/bin/Release/netcoreapp3.0/GPONMonitor.Views.dll
  It was not possible to find any compatible framework version
  The specified framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
    - The following frameworks were found:
        3.0.0 at [/opt/hostedtoolcache/dotnet/shared/Microsoft.NETCore.App]

  You can resolve the problem by installing the specified framework and/or SDK.

  The .NET Core frameworks can be found at:
    - https://aka.ms/dotnet-download
/home/vsts/work/1/s/src/GPONMonitor/GPONMonitor.csproj(37,5): error MSB3073: The command "dotnet bundle" exited with code 150.
##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
##[error]Dotnet command failed with non-zero exit code on the following projects : /home/vsts/work/1/s/src/GPONMonitor/GPONMonitor.csproj

Steps to recreate

  1. Build code from repository: https://github.com/bartekkois/GPONMonitor under Azure Devops
martincostello commented 4 years ago

Likely related to #450, as I also have this issue in my repro there.

saber-wang commented 4 years ago

@martincostello look here https://github.com/dotnet/cli/issues/10288

eriksendc commented 4 years ago

Initially I was getting this exact error. I was able to work around this issue by adding a Use .Net Core task after my Build task and before my Publish task. I set Version to 2.2.106, and set Package to install to SDK (includes runtime). I tried first just having Package to install be Runtime but that didn't work.

I have no idea if this information is helpful for finding a final fix, but at least for now I can build and publish without dotnet bundle failing.

eriksendc commented 4 years ago

Note that I posted another comment in issue 450 as well.

TLA020 commented 3 years ago

This libary has so many issues, is it deprecated? Nothing seems to be fixed or maintained