ncalc / ncalc

Mathematical Expressions Evaluator for .NET
https://ncalc.github.io/ncalc/
MIT License
533 stars 77 forks source link

Dependency on NCalc incorrectly resolved #27

Closed nataliaheliova closed 3 months ago

nataliaheliova commented 3 years ago

Hi there,

I have a project targeting .NET Framework 4.8 with Paket as a dependency manager. NCalc is my indirect reference (e.g. I am referencing another library which is directly referencing NCalc). After running paket install, I noticed strange pattern:

<Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.8')">
      <ItemGroup>
        <Reference Include="NCalc">
          <HintPath>..\..\..\..\..\packages\NCalcSync\lib\net35\NCalc.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.7.1') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And $(TargetFrameworkVersion) == 'v2.0')">
      <ItemGroup>
        <Reference Include="NCalc">
          <HintPath>..\..\..\..\..\packages\NCalcSync\lib\netstandard2.0\NCalc.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
</Choose>

Is there any reason why targeting .NET Framework 4.8 would resolve in using net35 version of the library instead of netstandard2.0?

Thanks!

yallie commented 3 years ago

Hello @nataliaheliova, it looks to me like a typo in the nuget package.

nataliaheliova commented 3 years ago

Hey @yallie,

thanks for a quick respond.

You mean ncalc nuget package, right? Is it something I could potentionally help to fix?

yallie commented 3 years ago

You mean ncalc nuget package, right?

No, NCalcSync nuget package doesn't have any conditions related to the target framework version. I was referring to your library package that references ncalc.

NCalcSync package currently has two targets, net35 and netstandard20. If your app is targeting net48, I don't think there is any difference which one is used. Both of them should work exactly the same.

Is it something I could potentionally help to fix?

Please contact the library developers to clarify whether it's not a typo in their nuspec file. If something needs to be changed in ncalc itself, please ask them to file an issue here.

Thanks! :)

gumbarros commented 3 months ago

Feel free to re-open the issue if the error persists.