Visual Studio 2019 F#NU1101找不到包FSharp.core [英] Visual Studio 2019 F# NU1101 Unable to find package FSharp.core

查看:17
本文介绍了Visual Studio 2019 F#NU1101找不到包FSharp.core的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用Microsoft Visual Studio和F#。

我已经尽可能地按照他们的教程操作,但是当我尝试运行他们告诉我的代码时,我收到错误:

NU1101: Unable to find package FSharp.Core. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages

我在文件中的整个代码如下所示:

module HelloSquare

let square x = x * x

[<EntryPoint>]
let main argv =
    printfn "%d squared is: %d!" 12 (square 12)
    0 // Return an integer exit code

我如何修复此问题?任何帮助都将不胜感激,如果对撞击解决问题有帮助,我绝对愿意提供更多信息。

编辑: 这是一个.NET核心项目

以下是我正在学习的教程: https://docs.microsoft.com/en-us/dotnet/fsharp/get-started/get-started-visual-studio

以下是我遵循的安装教程,我做的是Visual Studio部分,而不是Visual Studio代码、Mac或服务器部分: https://docs.microsoft.com/en-us/dotnet/fsharp/get-started/install-fsharp#install-f-with-visual-studio

如何切换到联机Nuget源?

推荐答案

检查是否至少使用以下命令配置了一个Nuget源:

dotnet nuget list source

它应该返回如下内容:

Registered Sources:
  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json

如果您没有配置任何源,请使用dotnet nuget add source添加一个源。

例如:

dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org

我认为这可能是当前版本的DotNet核心(5.0.6)存在问题

这篇关于Visual Studio 2019 F#NU1101找不到包FSharp.core的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆