fsprojects/ExcelFinancialFunctions

.NET Core Support

Closed this issue · 16 comments

Add support for .NET Core

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

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.

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

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

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

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

@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

See this PR: #12

dsyme commented

Merged

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

@vanthome Could you try it out?

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

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.

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?

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

dsyme commented

Please do, that would be great!

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

Nice!