tomakita/Colorful.Console

Cannot publish single file.

Opened this issue · 3 comments

I am attempting to publish my .net core 3.1 application single file including Colorful.Console and it is causing "Detecting package downgrade errors". This should be due to Colorful.Console not supporting certain newer libraries like System.Runtime.InteropServices v4.3. I have attached a copy paste from a publish command

C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: Detected package downgrade: System.Runtime.InteropServices from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version. C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.Console 4.0.0 -> runtime.win.System.Console 4.3.0 -> System.Runtime.InteropServices (>= 4.3.0) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.Runtime.InteropServices (>= 4.1.0) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: Detected package downgrade: System.Collections from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version. C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Collections (>= 4.3.0) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.Collections (>= 4.0.11) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: Detected package downgrade: System.Diagnostics.Debug from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version. C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Diagnostics.Debug (>= 4.3.0) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.Diagnostics.Debug (>= 4.0.11) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: Detected package downgrade: System.Runtime.Handles from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version. C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Runtime.Handles (>= 4.3.0) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.IO.FileSystem 4.0.1 -> System.Runtime.Handles (>= 4.0.1) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: Detected package downgrade: System.Runtime.InteropServices from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version. C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Runtime.InteropServices (>= 4.3.0) C:\Users\siriu\source\repos\itemcoin-desktop\ProtocolBase.csproj : error NU1605: ProtocolBase -> Colorful.Console 1.2.9 -> System.Runtime.InteropServices (>= 4.1.0)

Hello,
I met the same issue on my projects when publishing. Just to say...

25>Warning As Error: Detected package downgrade: System.IO from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version. 
25> Malva.Dispatchers -> Colorful.Console 1.2.15 -> System.Console 4.0.0 -> runtime.win.System.Console 4.3.0 -> System.IO (>= 4.3.0) 
25> Malva.Dispatchers -> Colorful.Console 1.2.15 -> System.Console 4.0.0 -> System.IO (>= 4.1.0)

For one, I don't think this issue lies in the library. When I originally opened this issue, I didn't really know what I was doing. Make sure you are using your build tools correctly.

For two, given that it's been over 4 years since I filed it, I don't think this is going to see any action from a maintainer.

I'm pretty sure it lies in the library, it has inconsistencies in the dependencies which use differents version of netstandard libraries:

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
  <PackageReference Include="Microsoft.CSharp" Version="4.0.1" />
  <PackageReference Include="System.Collections" Version="4.0.11" />
  <PackageReference Include="System.Collections.Concurrent" Version="4.0.12" />
  <PackageReference Include="System.Console" Version="4.0.0" />
  <PackageReference Include="System.Diagnostics.Debug" Version="4.0.11" />
  <PackageReference Include="System.Dynamic.Runtime" Version="4.0.11" />
  <PackageReference Include="System.Globalization" Version="4.0.11" />
  <PackageReference Include="System.IO.FileSystem" Version="4.0.1" />
  <PackageReference Include="System.Linq" Version="4.1.0" />
  <PackageReference Include="System.Runtime" Version="4.1.0" />
  <PackageReference Include="System.Runtime.Extensions" Version="4.1.0" />
  <PackageReference Include="System.Runtime.InteropServices" Version="4.1.0" />
  <PackageReference Include="System.Text.RegularExpressions" Version="4.1.0" />
</ItemGroup>

I changed this and it fixed the issue. I pushed a PR (#94) but I'm not sure it will be merged, the project seems abandonned. @tomakita ?