vscode互动笔记本nuget目录错误

发布于 2025-02-09 02:36:33 字数 367 浏览 1 评论 0原文

我试图在我的C#单元格中包含一个nuget软件包,如以下示例:

#r "nuget: PackageIWantToInclude"

突然间,我有类似的错误:

Error: PackageManagement Error 3217 The source directory 'D:\MyLocalDirectory' not found

请注意,我在设置上没有对任何目录进行任何用地址> 进行任何编辑。 'd:\ mylocaldirectory'。我还在其他地方寻找解决方案而没有任何成功。谁能给我提示如何将源目录恢复到其默认设置中?

I was trying to include a nuget package in my C# cell, like the example below:

#r "nuget: PackageIWantToInclude"

when suddenly, I got a similar error like this:

Error: PackageManagement Error 3217 The source directory 'D:\MyLocalDirectory' not found

note that I have not made any edits on the settings pointing to any directory with the address 'D:\MyLocalDirectory'. I've also looked for a solution elsewhere without any success. Can anyone give me a hint on how to bring the source directory back into its default?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄意 2025-02-16 02:36:33

事实证明,vscode Interactive笔记本使用nuget.config中包含的Nuget配置,在“ C:\ Users {Computer Name} \ AppData \ roaming \ Nuget”中找到。

在发生错误发生的当前计算机中,我有一些本地软件包源已经不存在,尽管它们已经被禁用,但使用此命令dotnet nuget List source进行查看时,如所示。

我所做的是从nuget.config file删除不存在的软件包源 - 在此示例中:

    <add key="NonExistentSource" value="D:\MyLocalDirectory" />

然后我重新启动了笔记本内核,by:

Turns out, vscode interactive notebook uses the nuget configuration included in Nuget.Config found in "C:\Users{computer name}\AppData\Roaming\NuGet".

In that current machine where the error occurs, I have some local package sources included that were already non-existent, though they were already disabled, as indicated when viewed using this command dotnet nuget list source.

What I did was to remove the non-existent package source from the Nuget.Config file--in this example that would be:

    <add key="NonExistentSource" value="D:\MyLocalDirectory" />

and then I restarted the notebook kernel by:

  • opening Command Palette (CTRL+SHFT+P) or under View>>Command Palette..
  • and then selecting the restart notebook's kernelRestart
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文