fsprojects / ExcelFinancialFunctions

.NET Standard library providing the full set of financial functions from Excel.
https://fsprojects.github.io/ExcelFinancialFunctions
Other
195 stars 66 forks source link

.NET Core Support #9

Closed luajalla closed 2 years ago

luajalla commented 8 years ago

Add support for .NET Core

vanthome commented 8 years ago

when is this realistic to land? we have a need for it but would implement on our own otherwise.

luajalla commented 8 years ago

Hi @vanthome, I think FSharp.Core should work already with .NET core, that's basically what was needed (+project configuration). Unfortunately I cannot test it on Windows, so would be great if you could try that out.

vanthome commented 8 years ago

Yes, I also read that .net core is now F# ready. I'm also not using Wondows ;)

My Problem is I want to use the project as a dependency in a netcore app.

When I try to restore after adding it, I get this:

error: Package ExcelFinancialFunctions 2.3.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package ExcelFinancialFunctions 2.3.1 supports:
error:   - net40 (.NETFramework,Version=v4.0)
error:   - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
error: Package FSharp.Core 4.0.0.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package FSharp.Core 4.0.0.1 supports:
error:   - net20 (.NETFramework,Version=v2.0)
error:   - net40 (.NETFramework,Version=v4.0)
error:   - portable-monoandroid10+monotouch10+net45+xamarinios10 (.NETPortable,Version=v0.0,Profile=net45+monoandroid10+monotouch10+xamarinios10)
error:   - portable-net45+sl5+win8 (.NETPortable,Version=v0.0,Profile=Profile47)
error:   - portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7)
error:   - portable-net45+win8+wp8 (.NETPortable,Version=v0.0,Profile=Profile78)
error:   - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.

Then I tried to import net40 to make it happy like this:

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
      "net40"
      ]
    }
  },

But then it silently just not installs ExcelFinancialFunctions

So how can the package be made compatible with netcore?

dsyme commented 8 years ago

AFAIK it should be enough to convert this project to be a portable component targeting profile 259 (rather than profile 7). https://github.com/fsprojects/ExcelFinancialFunctions/blob/master/src/ExcelFinancialFunctions/ExcelFinancialFunctions.Portable.fsproj

vanthome commented 8 years ago

Hmm that sounds darn easy. As I'm using VS Code, it's probably better someone with VS is doing this. Also the project needs to be published to Nuget again.

dsyme commented 8 years ago

@vanthome You don't need to use VS to do this - just change the profile number, rebuild and see what happens.

vanthome commented 8 years ago

@dsyme that seemed to help but it failes with:


/temp3/ExcelFinancialFunctions/ExcelFinancialFunctions.sln (Rebuild) ->
(Rebuild target) ->
/temp3/ExcelFinancialFunctions/src/ExcelFinancialFunctions/ExcelFinancialFunctions.fsproj (Rebuild) ->

    /temp3/ExcelFinancialFunctions/src/ExcelFinancialFunctions/ExcelFinancialFunctions.fsproj: error : Target named 'Rebuild' not found in the project.

/temp3/ExcelFinancialFunctions/ExcelFinancialFunctions.sln (Rebuild) ->
(Rebuild target) ->

    /temp3/ExcelFinancialFunctions/tests/ExcelFinancialFunctions.Tests/ExcelFinancialFunctions.Tests.fsproj: error : /temp3/ExcelFinancialFunctions/tests/ExcelFinancialFunctions.Tests/ExcelFinancialFunctions.Tests.fsproj: The required attribute "Project" in Import is empty
    /temp3/ExcelFinancialFunctions/src/ExcelFinancialFunctions/ExcelFinancialFunctions.Portable.fsproj: error : /temp3/ExcelFinancialFunctions/src/ExcelFinancialFunctions/ExcelFinancialFunctions.Portable.fsproj: /temp3/ExcelFinancialFunctions/src/ExcelFinancialFunctions/ExcelFinancialFunctions.Portable.fsproj could not import "$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets"
dsyme commented 8 years ago

See this PR: https://github.com/fsprojects/ExcelFinancialFunctions/pull/12

dsyme commented 8 years ago

Merged

@luajalla @cpell Can you publish the updated nuget package?

@vanthome Could you try it out?

luajalla commented 8 years ago

@vanthome, please try with the latest package (v2.4).

vanthome commented 8 years ago

Unfortunately I get the same error as with the version before:

error: Package ExcelFinancialFunctions 2.4.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package ExcelFinancialFunctions 2.4.0 supports: portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
error: Package FSharp.Core 4.0.0.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package FSharp.Core 4.0.0.1 supports:
error:   - net20 (.NETFramework,Version=v2.0)
error:   - net40 (.NETFramework,Version=v4.0)
error:   - portable-monoandroid10+monotouch10+net45+xamarinios10 (.NETPortable,Version=v0.0,Profile=net45+monoandroid10+monotouch10+xamarinios10)
error:   - portable-net45+sl5+win8 (.NETPortable,Version=v0.0,Profile=Profile47)
error:   - portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7)
error:   - portable-net45+win8+wp8 (.NETPortable,Version=v0.0,Profile=Profile78)
error:   - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
benjaminjnr commented 7 years ago

I want to get this project to build in VS2017, will you be willing to accept a Pull Request?

It seems you prefer to use paket rather than nuget. How do I get the two to work harmoniously?

I am also new to the F# world, and I know you take the cross platform story very seriously. Any other pitfalls you think I should watch out for?

MokhtarAshour commented 5 years ago

Is there any update on this issue? If not, I can create a PR to do so with some help

dsyme commented 5 years ago

Please do, that would be great!

jcoliz commented 2 years ago

Now runs on .NET Core. Would love to hear any issues or concerns anyone finds.

benjaminjnr commented 2 years ago

Nice!