fsprojects / Paket.VisualStudio

Manage your Paket (http://fsprojects.github.io/Paket/) dependencies from Visual Studio!
MIT License
147 stars 51 forks source link

Visual Studio 2019 & .Net Core 3.1: Paket doesn't work...? #177

Closed gggggeorge closed 4 years ago

gggggeorge commented 4 years ago

Hello,

I have been using Paket in Visual Studio 2015, for maybe 2 years, and I am very familiar with it, and I like it -thanks! :smiley:

I'm hoping Paket will work just as well with Visual Studio 2019, as I don't want to go back to NuGet, but I see issues/comments going back a year, and I hope I'm wrong, but it kind of seems like it falls off a cliff after Visual Studio 2017. :confused:

Anyway, sorry to get off track, here is my error:

Description

Did a Build within Visual Studio 2019, and it fails with:

Error List:

Severity    Code    Description Project File    Line    Suppression State
Error   MSB3073 The command ""paket.exe" restore" exited with code 1.   LRDaily C:\SOURCE_CONTROL\S1\LRDaily\.paket\Paket.Restore.targets   120 

Output:

1>------ Rebuild All started: Project: LRDaily, Configuration: Debug Any CPU ------
1>Checking Paket version (downloading latest stable)...
1>Paket.exe 5.243.0 is up to date.
1>Paket version 5.206.0
1>Performance:
1> - Runtime: 381 milliseconds
1>Paket failed with
1>-> Error during parsing of 'C:\SOURCE_CONTROL\S1\LRDaily\paket.lock'.
1>-> invalid parameter 'netcoreapp3.1' after >= or < in '== netcoreapp3.1'
1>C:\SOURCE_CONTROL\PrimaryIT2\S1\LRDaily\.paket\Paket.Restore.targets(120,5): error MSB3073: The command ""paket.exe" restore" exited with code 1.
1>Done building project "LRDaily.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Repro steps

  1. Visual Studio 2019: create a new c# "Hello World" project with .Net Core 3.1. I created a class/library DLL, but I'm guessing it will also fail with a Console project, etc.

  2. I then simply created my normal:

paket.dependencies (at solution level):

source https://www.nuget.org/api/v2

framework: auto-detect

nuget System.Diagnostics.EventLog

paket.references (at project level): System.Diagnostics.EventLog

  1. I then did (at solution level) at the DOS prompt (to install the libraries -also tried a "-f" force, made no difference): .paket\paket.exe install

  2. I observed that my lock file was created, as per (at solution level): paket.lock

    RESTRICTION: == netcoreapp3.1
    NUGET
    remote: https://www.nuget.org/api/v2
    Microsoft.NETCore.Platforms (3.1)
    Microsoft.Win32.Registry (4.7)
      System.Security.AccessControl (>= 4.7)
      System.Security.Principal.Windows (>= 4.7)
    System.Diagnostics.EventLog (4.7)
      Microsoft.NETCore.Platforms (>= 3.1)
      Microsoft.Win32.Registry (>= 4.7)
      System.Security.Principal.Windows (>= 4.7)
    System.Security.AccessControl (4.7)
      Microsoft.NETCore.Platforms (>= 3.1)
      System.Security.Principal.Windows (>= 4.7)
    System.Security.Principal.Windows (4.7)

-and the install in (3) seemed to work fine, no errors.

  1. I then went back to Visual Studio 2019, and did a "Build", and then I got the error indicated (in the Description).

Expected behavior

Project should have built.

Actual behavior

Project build failed.

Known workarounds

Go back to NuGet? :worried:

Related information

Thanks, George H. 04/10/2020 5:30pm ET

gggggeorge commented 4 years ago

Sorry, closing this, and moving issue to Paket, instead of Packet.VisualStudio.