Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop FSI #r nuget fails on preview build #9150

Closed
KevinRansom opened this issue May 7, 2020 · 3 comments · Fixed by #10114
Closed

Desktop FSI #r nuget fails on preview build #9150

KevinRansom opened this issue May 7, 2020 · 3 comments · Fixed by #10114
Assignees
Labels
Area-FSI Bug Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code.
Milestone

Comments

@KevinRansom
Copy link
Member

A normal VS managed code workload VS install, fsi, fails to correctly execute #r nuget.

This fails because the .NetFramework 4.8 sdk is not installed. --- we should do a better job.

fsi --langversion:preview

Produces this output:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview>fsi --langversion:preview

Microsoft (R) F# Interactive version 10.10.0.0 for F# 4.7
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> #r "nuget:FSharp.Data"; let _=();;
Microsoft (R) Build Engine version 16.7.0-preview-20228-06+9571f7584 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/6/2020 6:08:47 PM.
Project "C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj" on node 1 (Restore target(s)).
_GetAllRestoreProjectPathItems:
  Determining projects to restore...
Restore:
  Restoring packages for C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj...
    CACHE https://api.nuget.org/v3-flatcontainer/fsharp.data/index.json
  Committing restore...
  Generating MSBuild file C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\obj\Project.fsproj.nuget.g.props.
  Generating MSBuild file C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\obj\Project.fsproj.nuget.g.targets.
  Writing assets file to disk. Path: C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\obj\project.assets.json
  Restored C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj (in 434 ms).

  NuGet Config files used:
      C:\Users\codec\AppData\Roaming\NuGet\NuGet.Config
      C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config

  Feeds used:
      https://api.nuget.org/v3/index.json
      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Done Building Project "C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj" (Restore target(s)).
Project "C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj" on node 1 (InteractivePackageManagement target(s)).
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.8 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj]
Done Building Project "C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj" (InteractivePackageManagement target(s)) -- FAILED.

Build FAILED.

"C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj" (InteractivePackageManagement target) (1:7) ->
(GetReferenceAssemblyPaths target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.8 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [C:\Users\codec\AppData\Local\Temp\nuget\16300--c64de8b9-9471-4870-be44-6299ba8800c7\Project.fsproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.26
@KevinRansom KevinRansom added the Bug label May 7, 2020
@KevinRansom KevinRansom self-assigned this May 7, 2020
@dsyme
Copy link
Contributor

dsyme commented Sep 1, 2020

@KevinRansom Is this a must-fix bug? To have #r "nuget" working with desktop FSI? #9150

I guess it either has to work or give a decent diagnostic

@dsyme dsyme added Area-FSI Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. labels Sep 1, 2020
@abelbraaksma
Copy link
Contributor

It actually works for me from VS, which uses netfx.

@cartermp cartermp added this to the Backlog milestone Sep 1, 2020
@jonsequitur jonsequitur modified the milestones: Backlog, 16.8 Sep 8, 2020
@KevinRansom
Copy link
Member Author

To see the failure run the dogfood build when using s default install on a clean machine:

FSharp\fsi.exe --langversion:preview

Microsoft (R) F# Interactive version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> #r "nuget:FSharp.Data";;

produces this error message:

Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.8 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [C:\Users\WDAGUtilityAccount\AppData\Local\Temp\nuget\2144--92e31973-7621-48ec-8e95-7ff9c62eb8f5\Project.fsproj]
>

Whilst I think the error message is pretty decent, since it gives a mechanism how to resolve the issue, I think we should consider how to reduce the friction even further:

  1. Have FSI default to 4.7.2 --- this matches VS default selection, although the developer can pick an alternate and FSI is clueless.
  2. Have VS change default to 4.8 to match the VS shipping. --- same issue developer can pick something else and FSI is clueless.
  3. Use Automagic probing. Oh yeah automagic rocks !!! no it doesn't but it has only one issue, when the developer selected nothing.
  4. Use the rather groovy ... https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies
    Just add net4.8 reference assemblies when doing the #i nuget stuff.

I'm going to give option 4 a whirl, since it is more or less friction free, and ends up doing the exact right thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-FSI Bug Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants