fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

error NU1100: Unable to resolve 'FSharp.Core (>= 4.7.2)' for '.NETCoreApp,Version=v3.1'.

Open voh83 opened this issue 6 years ago • 12 comments

description

I can't make a F# console app with vscode

Provide the steps required to reproduce the problem:

  1. cd (mkdir Fsharptest)
  2. dotnet new console --lang "F#"
  3. dotnet run

Expected behavior

Hello World from F#!

Actual behavior

Get this error: error NU1100: Unable to resolve 'FSharp.Core (>= 4.7.2)' for '.NETCoreApp,Version=v3.1'.

I tried to install manually FSharp core 4.7.2 without success.

dotnet --info

.NET Core SDK (reflecting any global.json): Version: 3.1.402 Commit: 9b5de826fd

Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.402\

Host (useful for support): Version: 3.1.8 Commit: 9c1330dedd

.NET Core SDKs installed: 3.1.402 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

voh83 avatar Sep 18 '20 16:09 voh83

@dnomar , could you please run

dotnet build /bl

And then zip up the Fsharptest folder and drop it here.

Thanks Kevin

KevinRansom avatar Sep 18 '20 20:09 KevinRansom

Build fail, this what appear in the terminal.

Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.        

C:\Program Files\dotnet\sdk\3.1.101\MSBuild.dll -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\3.1.101\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\3.1.101\dotnet.dll -maxcpucount -restore -verbosity:m /bl .\Ftest.fsproj
C:\Users\vlonc_000\Documents\08 code\Ftest\Ftest.fsproj : error NU1100: Unable to resolve 'FSharp.Core (>= 4.7.0)' for '.NETCoreApp,Version=v3.1'.
  Restore failed in 175.41 ms for C:\Users\vlonc_000\Documents\08 code\Ftest\Ftest.fsproj.

Build FAILED.

C:\Users\vlonc_000\Documents\08 code\Ftest\Ftest.fsproj : error NU1100: Unable to resolve 'FSharp.Core (>= 4.7.0)' for '.NETCoreApp,Version=v3.1'.
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.02

voh83 avatar Sep 18 '20 20:09 voh83

If you specified /bl it will produce an msbuild.binlog, could you upload that file please.

Thanks,

Kevin

KevinRansom avatar Sep 18 '20 20:09 KevinRansom

Here is the file.

msbuild.zip

voh83 avatar Sep 18 '20 20:09 voh83

@dnomar --- could you please take a looka nd see if the file:

C:\Users\vlonc_000\AppData\Roaming\NuGet\NuGet.Config

contains an entry that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

It really should, I can't imagine it wouldn't but ... you know ....

Thanks

Kevin

KevinRansom avatar Sep 18 '20 21:09 KevinRansom

Kevin, my file contains the following code:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <activePackageSource>
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
  </activePackageSource>
</configuration>

thanks

Van

voh83 avatar Sep 18 '20 21:09 voh83

It works.... :).

i replaced the configuration file. ¿Why this happened?

thanks you very much.

Van

voh83 avatar Sep 18 '20 22:09 voh83

I guess the file format has changed over the years. Anyway, I'm glad we fixed it. Because I was running out of Ideas :-)

Kevin

KevinRansom avatar Sep 18 '20 23:09 KevinRansom

@dnomar --- could you please take a looka nd see if the file:

C:\Users\vlonc_000\AppData\Roaming\NuGet\NuGet.Config

contains an entry that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

It really should, I can't imagine it wouldn't but ... you know ....

Thanks

Kevin

This is very helpful. Thank you

Nick-Foto avatar Apr 10 '21 04:04 Nick-Foto

@dnomar --- could you please take a looka nd see if the file:

C:\Users\vlonc_000\AppData\Roaming\NuGet\NuGet.Config

contains an entry that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

It really should, I can't imagine it wouldn't but ... you know ....

Thanks

Kevin

Amazing, fixed it for me as well, thanks!

Matteeh avatar May 11 '21 19:05 Matteeh

Just commenting to say I got the same error with dotnet 5 when I was trying to get started with f#, and I had this as the NuGet.Config for some reason:

<?xml version="1.0" encoding="utf-8"?>
<configuration />

Replacing the config file with the suggestion above seems to have fixed the issue.

joakin avatar May 27 '21 09:05 joakin

Just commenting to say I got the same error with dotnet 5 when I was trying to get started with f#, and I had this as the NuGet.Config for some reason:

<?xml version="1.0" encoding="utf-8"?>
<configuration />

Replacing the config file with the suggestion above seems to have fixed the issue.

Same problem, same fix! Thanks!

Wutklumpen avatar Jun 09 '21 08:06 Wutklumpen