"It was not possible to find any compatible framework version" with ASP.NET Core 2.2
I think the issue is coming from your PrepublishScript
(dotnet bundle
). The package BundlerMinifier.Core
(version 2.9.406) has dependencies on:
.NETCoreApp1.0
.NETCoreApp2.0
.NETFramework4.5.2
.NETStandard2.0
It seems since the project targets netcoreapp2.2
, this reference is failing and either actually falling back to netcoreapp1.0
or is just giving a misleading message. To sanity check, perhaps downgrade the project to netcoreapp2.0
to verify if it works or not.
Just a note, netcoreapp2.2
implements netstandard2.0
, so I would expect this to all work, but it is possible the inference isn't happening during dependency resolution.
The solution was that I had an old version of BundlerMinifier.Core referenced - Changing that solved the problem:
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.9.406" />
I also found a bug description: https://github.com/madskristensen/BundlerMinifier/issues/292