Skip to content

[15.3 pre] loading in VS / publish fails if FSharp.Compiler.Tools is imported #3335

Closed

Description

@0x53A

Edit2: everything works, thanks @KevinRansom

Edited

I have tried to test if / how a project using paket works in the new world of dotnet 2, comparing C#, F#, and the previous F# sdk (FSharp.NET.Sdk). I have also tested if using F# without paket works.

Here are four branches, one for each test: https://github.com/0x53A/dotnet-tests.

Results:

The paket version I have tested this with is 5.6.12.

It is kind of funny that C# seems to work flawlessly with paket.

Activity

  1. 0x53A commented on Jul 14, 2017

    @0x53A
    ContributorAuthor

    I am mostly interested in how to find out the cause of "Project file is incomplete. Expected imports missing." That may be something that could be changed on the paket side. (It would be even better if it worked without changes on the paket side).

  2. 0x53A commented on Jul 14, 2017

    @0x53A
    ContributorAuthor

    I assume it is an issue in the F# implementation of Microsoft.NET.Sdk.

    The equivalent C# project does work without issues:

    <Project Sdk="Microsoft.NET.Sdk">
      
      <PropertyGroup>
        <TargetFramework>net461</TargetFramework>
      </PropertyGroup>
      
      <Import Project="..\.paket\Paket.Restore.targets" />
      
    </Project> 
    

    image

    full project: paket-csharp-test.zip

  3. forki commented on Jul 14, 2017

    @forki
    Contributor

    @enricosada probably knows

  4. cartermp commented on Jul 14, 2017

    @cartermp
    Contributor

    This does seem like a bug given that the same import works with C# projects. cc @KevinRansom

  5. added this to the milestone on Jul 14, 2017
  6. KevinRansom commented on Jul 14, 2017

    @KevinRansom
    Contributor

    @0x53A
    how is this file "...paket\Paket.Restore.targets" expected to get on the machine?

    This is a dotnet sdk csproj with the paket import on a cleanly installed vs2017:

    image

    I believe the FSharp.Net sdk may have explicitly added support for paket.

  7. forki commented on Jul 14, 2017

    @forki
    Contributor

    No there was no support build into the sdk.

    Paket.Restore.targets comes from paket itself. When you call install command.

  8. 0x53A commented on Jul 14, 2017

    @0x53A
    ContributorAuthor

    Edited, please see initial post

  9. 0x53A commented on Jul 14, 2017

    @0x53A
    ContributorAuthor

    @KevinRansom Attached is a working (well, at least for me) C# project

    paket-csharp-test.zip

  10. KevinRansom commented on Jul 14, 2017

    @KevinRansom
    Contributor

    @0x53A
    On my machine paket.exe wasn't in the .paket directory. Copying it to the .paket directory made it work fine.

    Looking at the targets that seems to be the case. Does that work for you?

  11. 0x53A commented on Jul 14, 2017

    @0x53A
    ContributorAuthor

    @KevinRansom Sorry, my initial post was a bit sloppy, just copy-pasting project xmls.

    I have created a repository, with one branch for each test.

    Can you please test if this works on your machine? My result is in readme.md https://github.com/0x53A/dotnet-tests/tree/fsharp+paket

  12. cartermp commented on Jul 14, 2017

    @cartermp
    Contributor

    Should there be a paket.exe in both the root director and the .paket folder?

  13. 0x53A commented on Jul 14, 2017

    @0x53A
    ContributorAuthor

    it looks like it doesn't matter, as long as there is one in either the root or the .paket.

  14. 39 remaining items

  15. 0x53A commented on Jul 15, 2017

    @0x53A
    ContributorAuthor

    @forki Thinking about this a little more, here is my preference for paket:

    Always set DisableImplicitFSharpCoreReference and DisableImplicitSystemValueTupleReference.
    Error out if there is no reference to the FSharp.Core nuget package, either explicitly, or as a transitive.

    Maybe we should move that discussion to the paket repo ...

  16. KevinRansom commented on Jul 16, 2017

    @KevinRansom
    Contributor

    @0x53A @forki
    Those switches are specifically to enable developers to override the defaults. So a paket converted project should set them if a developer wishes to use paket to override the behavior.

  17. forki commented on Jul 17, 2017

    @forki
    Contributor

    @KevinRansom yes but we're discussing if it should reference fsharp.core and valuetuple at all. I personally see only disadvantages of this. I think it should be removed right now before it hits a release and we have backwards compatibility issues.

    Instead the dotnet template should explicitly reference it.

  18. 0x53A commented on Jul 17, 2017

    @0x53A
    ContributorAuthor

    I think the auto referencing is great if you just want to get started. Similar to fsc.exe source.fs working.

    But if you have a medium sized project, you never want "something" to be referenced, you need to actually control what you reference.

    So I kind of agree with forki. The downside is two more lines in the absolutely simplest project.
    The upside is more control and less unexpected behavior.

  19. forki commented on Jul 17, 2017

    @forki
    Contributor

    "The downside is two more lines in the absolutely simplest project."

    that would be scaffolded by dotnet new - I don't see that as a downside.

  20. KevinRansom commented on Jul 17, 2017

    @KevinRansom
    Contributor

    There are knobs to disable it. You can control when you need to, and not be bothered by it when you don't want to.

    Set the disable flags and type what you want.

  21. forki commented on Jul 17, 2017

    @forki
    Contributor
  22. 0x53A commented on Jul 17, 2017

    @0x53A
    ContributorAuthor

    @forki, they do work correctly for the sdk, but unfortunately the compiler has a second magic reference resolution for fsharp.core. see #3340

  23. forki commented on Jul 17, 2017

    @forki
    Contributor

    yes that's what I meant. The sdk build should never succeed - it should probably pass an arg to compiler.

  24. 0x53A commented on Jul 17, 2017

    @0x53A
    ContributorAuthor

    @forki I went through https://docs.microsoft.com/de-de/dotnet/fsharp/language-reference/compiler-options, and there does not seem to be a way to disable that (unless there is an undocumented flag).

  25. forki commented on Jul 17, 2017

    @forki
    Contributor

    @0x53A yeah it needs to pass a NEW arg ;-)

  26. 0x53A commented on Jul 17, 2017

    @0x53A
    ContributorAuthor

    sooo, do you want to work on the pr? :D

  27. forki commented on Jul 17, 2017

    @forki
    Contributor

    no I actually just want it to work ;-)

  28. modified the milestones: , .NET Core 2.0 on Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions