错误:NU1100:无法解析“net5.0"的“MicrosoftOfficeCore (>= 15.0.0)" [英] error: NU1100: Unable to resolve 'MicrosoftOfficeCore (>= 15.0.0)' for 'net5.0'
问题描述
在 Visual Studio Code 的终端中,当我尝试运行时:
In Terminal of Visual Studio Code, when I try to run:
dotnet add package MicrosoftOfficeCore --version 15.0.0
我在 Visual Studio Code 终端上收到以下错误
I get the following error on Visual Studio Code terminal
error: NU1100: Unable to resolve 'MicrosoftOfficeCore (>= 15.0.0)' for 'net5.0'
error: Package 'MicrosoftOfficeCore' is incompatible with 'all' frameworks in project
你有什么想法吗?
非常感谢.
推荐答案
尝试使用
dotnet nuget locals all --clear
清除 NuGet 缓存,然后尝试添加您的包.
Try clearing the NuGet cache using
dotnet nuget locals all --clear
, and then try to add your package.
如果这不起作用,请尝试删除 C:\Users\
NuGet.config 文件> 目录,然后使用 dotnet restore
命令恢复它.在此之后尝试添加您的包.
If that doesn't work, try deleting the NuGet.config
file present inside C:\Users\<username>\AppData\Roaming\NuGet
directory, and then restore it using dotnet restore
command. Try adding your package after this.
这篇关于错误:NU1100:无法解析“net5.0"的“MicrosoftOfficeCore (>= 15.0.0)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!