error NU1100: Unable to resolve 'FSharp.Core (>= 4.7.2)' for '.NETCoreApp,Version=v3.1'.
description
I can't make a F# console app with vscode
Provide the steps required to reproduce the problem:
- cd (mkdir Fsharptest)
- dotnet new console --lang "F#"
- 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
@dnomar , could you please run
dotnet build /bl
And then zip up the Fsharptest folder and drop it here.
Thanks Kevin
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
If you specified /bl it will produce an msbuild.binlog, could you upload that file please.
Thanks,
Kevin
@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
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
It works.... :).
i replaced the configuration file. ¿Why this happened?
thanks you very much.
Van
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
@dnomar --- could you please take a looka nd see if the file:
C:\Users\vlonc_000\AppData\Roaming\NuGet\NuGet.Configcontains 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
@dnomar --- could you please take a looka nd see if the file:
C:\Users\vlonc_000\AppData\Roaming\NuGet\NuGet.Configcontains 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!
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.
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!