You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Paket fails on projects that target multiple frameworks #2496
I made a very simple project that only depends on one package. It targets both .NET Standard 1.6 and .NET Framework 4.6.2. Running paket install and paket restore gives no errors. But when it run dotnet restore, Paket says this:
C:\code\paket_bug\.paket\Paket.Restore.targets(22,5): error MSB3073: The command ""C:\code\paket_bug\.paket\paket.exe" restore --project "C:\code\paket_bug\Hello.fsproj" --target-framework " exited with code 1. [C:\code\paket_bug\Hello.fsproj]
In the project file, there is a TargetFrameworks section, not the TargetFramework that paket.restore.targets asks for. paket.restore.targets should handle it somehow. On projects that target one framework and have the TargetFramework property, Paket works like a charm.
Version information
paket --version: Paket version 5.5.3 dotnet --version: 2.0.0-preview2-006497
I guess so. But I uninstalled the preview CLI and the same error appeared. I also tried to "bisect" the bug by trying with Paket 5.0.0, but it happened again. I guess it's something else in my machine that changed. In the past I could make cross-framework packages with Paket and without problem.
We should probably use the TargetFrameworks variable. the TargetFramework variable only is syntactic sugar afaik.
I will try to see if it does anything. Currently, my project only targets .NET 4.6.2. 😢
We should probably use the TargetFrameworks variable. the TargetFramework variable only is syntactic sugar afaik.
Can confirm that the plural works $(TargetFrameworks). I was hit by this error too:
error : argument '--target-framework' must be followed by <framework>.
.NET Command Line Tools (1.0.1)
Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40cd1
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.1
This makes sense to me, given the usage of the @ in Paket.Restore.targets. As far as I knew @ only worked with ItemGroups. Unless there is "magic" where the dotnet cli/msbuild is supposed to convert the TargetFrameworks property into items?
Activity
forki commentedon Jul 8, 2017
This sounds like an issue with dotnet cli itself. Why is it not providing the target framework information?
teo-tsirpanis commentedon Jul 8, 2017
Which of them? .NET Standard 1.6 or .NET Framework 4.6.2? I will test it with the stable CLI.
forki commentedon Jul 8, 2017
We I tested multi target it actually called paket restore two times. One with every framework
matthid commentedon Jul 8, 2017
We should probably use the
TargetFrameworksvariable. theTargetFrameworkvariable only is syntactic sugar afaik.matthid commentedon Jul 8, 2017
/cc @enricosada
matthid commentedon Jul 8, 2017
Or a breaking change in
2.0.0-preview2-006497?teo-tsirpanis commentedon Jul 8, 2017
I guess so. But I uninstalled the preview CLI and the same error appeared. I also tried to "bisect" the bug by trying with Paket 5.0.0, but it happened again. I guess it's something else in my machine that changed. In the past I could make cross-framework packages with Paket and without problem.
I will try to see if it does anything. Currently, my project only targets .NET 4.6.2. 😢
teo-tsirpanis commentedon Jul 8, 2017
No luck. 🙁
Mpdreamz commentedon Jul 14, 2017
Can confirm that the plural works
$(TargetFrameworks). I was hit by this error too:error : argument '--target-framework' must be followed by <framework>.forki commentedon Jul 14, 2017
@Mpdreamz can you please upload a zip with a repro
Mpdreamz commentedon Jul 14, 2017
Working on a PR with integration test 😄 hopefully I get somewhere otherwise will upload a repro
forki commentedon Jul 14, 2017
even better ;-)
started on repro for fsprojects#2496 as failing test and worked on a fix
teo-tsirpanis commentedon Jul 17, 2017
The bug seems fixed with Paket 5.7.0.
However, why is Paket run three times while
dotnet restoreing a project that targets two frameworks?forki commentedon Jul 17, 2017
I think one is for discovering the cli tools
seanamosw commentedon Jul 18, 2017
With the latest Paket.Restore.targets I still wasn't able to get this to work.
eg.
However, this works:
This makes sense to me, given the usage of the
@in Paket.Restore.targets. As far as I knew@only worked with ItemGroups. Unless there is "magic" where the dotnet cli/msbuild is supposed to convert the TargetFrameworks property into items?forki commentedon Jul 18, 2017
@seanamosw oh. can you please suggest a PR with a fix to the targets file so that thefirst thing works?
forki commentedon Jul 18, 2017
@Mpdreamz do you see the issue?
Mpdreamz commentedon Jul 18, 2017
I have not yet tested the new release or the updates but my original commit splitted the tfm
Mpdreamz@513491b
Which then allows @ to itterate each item.
Now we pass the string verbatim and let paket expand it internally (:+1:) it should be
$(TargetFrameworks)here https://github.com/fsprojects/Paket/blob/master/.paket/Paket.Restore.targets#L23forki commentedon Jul 18, 2017
ok changing it right now!
forki commentedon Jul 18, 2017
fixed. @seanamosw can you please try it?
seanamosw commentedon Jul 18, 2017
Can confirm the change to
$(TargetFrameworks)works. I had been using this exact change as temporary workaround locally.