8000 Please make a version for .NET Framework 4.8 compatibility · Issue #1 · confessore/CoinbaseAT · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Please make a version for .NET Framework 4.8 compatibility #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
astrohart opened this issue Dec 26, 2023 · 7 comments
Open

Please make a version for .NET Framework 4.8 compatibility #1

astrohart opened this issue Dec 26, 2023 · 7 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested

Comments

@astrohart
Copy link
astrohart commented Dec 26, 2023

@confessore Hi,

I frequently still like to use .NET Framework 4.8 / 4.8.1 in my projects. I respectfully request if you could please make a version of the NuGet package that has compatibility with those framework versions. Currently, the NuGet package will not install in my .NET Framework 4.8 project. Thank you.

@astrohart
Copy link
Author
astrohart commented Dec 26, 2023

@confessore This is the error I get when I attempt to install the NuGet package



Attempting to gather dependency information for package 'CoinbaseAT.1.0.1' with respect to project 'xyLOGIX.Coinbase.AdvancedTrade.Extensions', targeting '.NETFramework,Version=v4.8'
Gathering dependency information took 6 ms
Attempting to resolve dependencies for package 'CoinbaseAT.1.0.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'CoinbaseAT.1.0.1'
Resolved actions to install package 'CoinbaseAT.1.0.1'
Install failed. Rolling back...
Package 'CoinbaseAT.1.0.1' does not exist in project 'xyLOGIX.Coinbase.AdvancedTrade.Extensions'
Package 'CoinbaseAT.1.0.1' does not exist in folder 'C:\Users\Brian Hart\source\repos\astrohart\xyLOGIX.Coinbase.AdvancedTrade.VS2019\packages'
Executing nuget actions took 66 ms
Could not install package 'CoinbaseAT 1.0.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Time Elapsed: 00:00:00.0761033
========== Finished ==========

@confessore
Copy link
Owner

hi @astrohart ,

thanks for reaching out.

i understand completely. i almost exclusively utilize net framework at work. this is something that can be done.

thinking there may be some specific targeted blocks but i also think net6+ is mature and covers everything netframework4+ does at this point.

i'll turn my desktop on and multi target this somehow.

@astrohart
Copy link
Author

Hello @confessore

In line 64 of CoinbaseATConfiguration.cs I saw you use Convert.ToHexString to create the Coinbase signature. The Convert.ToHexString method is not available for .NET Framework 4.8.1 and lower, so you have to roll your own.

I found some code at this Stack Overflow post and implemented it thus:

using System;

namespace MyExtensions
{
    /// <summary>
    /// Extension methods to supplement the functionality of <c>byte</c> arrays.
    /// </summary>
    public static class ByteArrayExtensions
    {
        /// <summary>
        /// Converts the specified <paramref name="bytes" /> into a string consisting of
        /// hexadecimal digits.
        /// </summary>
        /// <param name="bytes">
        /// (Required.) An array of greater than zero bytes that are to be converted to a
        /// string of the equivalent hexadecimal digits.
        /// </param>
        public static string ToHexString(this byte[] bytes)
        {
            var result = string.Empty;

            try
            {
                if (bytes == null) return result;
                if (bytes.Length == 0) return result;

                result = BitConverter.ToString(bytes)
                                     .Replace("-", "");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);

                result = string.Empty;
            }

            return result;
        }
    }
}

@confessore
Copy link
Owner
confessore commented Dec 29, 2023

so I'm looking at a multi-target for net7.0 (possibly an upgrade to net8.0 soon) as well as netstandard2.0.

I'm getting at least 500 errors which are pretty much all accounting for nullables which aren't supported as well as in language versions later than 7.3.

sorry about the formatting.
are you aware of any way to better support nullables with a similar project configuration?

    <TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>
    <LanguageVersion Condition=" '$(Framework)' == 'NETSTANDARD2_0' ">7.3</LanguageVersion>
    <Nullable Condition=" '$(Framework)' == 'NET7_0' ">enable</Nullable>

here is an example of the solution that I have in mind for this. maybe you have a better idea?
i personally would really dislike to remove features for later language versions however having a homogenous codebase is on my mind as well.

  // Copyright (c) Steven Confessore - Balanced Solutions Software - CoinbaseAT Contributors.  All Rights Reserved.  Licensed under the MIT license.  See LICENSE in the project root for license information.
  
  using CoinbaseAT.Models.Interfaces;
  
  namespace CoinbaseAT.Models;
  
  /// <summary>
  /// <inheritdoc cref="IFeeTier"/>
  /// </summary>
  public class FeeTier : IFeeTier
  {
  #if NET7_0_OR_GREATER
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string? Pricing_Tier { get; set; }
  
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string? USD_From { get; set; }
  
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string? USD_To { get; set; }
  
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string? Taker_Fee_Rate { get; set; }
  
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string? Maker_Fee_Rate { get; set; }
  #elif NETSTANDARD2_0_OR_GREATER
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string Pricing_Tier { get; set; }
  
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string USD_From { get; set; }
  
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string USD_To { get; set; }
  
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string Taker_Fee_Rate { get; set; }
  
      /// <summary>
      /// <inheritdoc/>
      /// </summary>
      public string Maker_Fee_Rate { get; set; }
  #endif
  }

@astrohart
Copy link
Author
astrohart commented Dec 29, 2023 via email

@confessore
Copy link
Owner
confessore commented Dec 31, 2023

so for dotnetcore (NET6+) i enjoy declaring nullables for entity framework purposes. migrating databases with nullables is special to me. it makes manual database operations much more manageable for my use case.

answer me this. does it make sense to create a framework repo?

i report back to work on tuesday, 2january. i wish to prioritize this issue in my personal time. please allow me to know if a multi target or multi repo makes the most sense.

@confessore
Copy link
Owner
confessore commented Jan 12, 2024

I am currently on short term disability leave at the moment.

models and model interfaces now include preprocessor directives for netstandard2.0 in
93eb77d

next on the list is to include preprocessor directives for netstandard2.0 on services and service interfaces

@confessore confessore self-assigned this Jan 12, 2024
@confessore confessore added enhancement New feature or request documentation Improvements or additions to documentation question Further information is requested labels Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants
0