wpf 无法找到版本 (>=3.0.0) 的软件包 Microsoft.NETCore.App
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/56491961/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unable to find package Microsoft.NETCore.App with version(>=3.0.0)
提问by A.HADDAD
I am trying to migrate my WPF(.net framework) project to WPF(.net core 3). So i have installed this Visual Studio Extensionand i m now able to create a new Wpf(.net core) project , but the problem starts when i add a nuget package ! , VS throws me this error :
我正在尝试将我的 WPF(.net framework) 项目迁移到 WPF(.net core 3)。所以我已经安装了这个 Visual Studio 扩展,我现在可以创建一个新的 Wpf(.net core) 项目,但是当我添加一个 nuget 包时问题就开始了!, VS 向我抛出此错误:
Unable to find package Microsoft.NETCore.App with version (>= 3.0.0-preview6-27730-01)
- Found 69 version(s) in nuget.org [ Nearest version: 3.0.0-preview5-27626-15 ]
- Found 0 version(s) in Microsoft Visual Studio Offline Packages TestwpfCore C:\Users\sintware\source\repos\TestwpfCore\TestwpfCore\TestwpfCore.csproj 1
采纳答案by A.HADDAD
After getting @Lance is comment , i downloaded the Core 3 preview 6and finally the problem is gone ,i can install nuget package without any problem.
得到@Lance 的评论后,我下载了Core 3 preview 6,最后问题消失了,我可以毫无问题地安装 nuget 包。
回答by Robin Krom
As dotnet core 3.0 is still in preview, you should put the following in a file called NuGet.Config in the root of your project (or merge with your existing file):
由于 dotnet core 3.0 仍处于预览阶段,您应该将以下内容放入项目根目录中名为 NuGet.Config 的文件中(或与现有文件合并):
<configuration>
<packageSources>
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-windowsdesktop" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
<add key="aspnet-aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
<add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
<add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
<add key="aspnet-extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
<add key="gRPC repository" value="https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev" />
</packageSources>
</configuration>
This will make sure the preview versions can be found!
这将确保可以找到预览版本!
This information can be found here: https://github.com/dotnet/core-sdk#installers-and-binaries
可以在此处找到此信息:https: //github.com/dotnet/core-sdk#installers-and-binaries
As soon as dotnet core 3.0 is released you should be able to remove these package sources.
一旦 dotnet core 3.0 发布,您应该能够删除这些包源。
回答by zivkan
Notice the error message says it's trying to find a package with version 3.0.0 preview6. If you go to https://dotnet.microsoft.com/download/dotnet-core/3.0you can see the latest public preview is preview 5. Therefore you, or the tool you used to migrate, is trying to use a nightly build of the .NET Core SDK, not a published version. The .NET SDK normally ships with its packages which get put in the NuGet Fallback Folder, so it appears that version of the .NET Core SDK wasn't installed correctly.
请注意错误消息说它正在尝试查找版本为 3.0.0 preview6 的包。如果您访问https://dotnet.microsoft.com/download/dotnet-core/3.0,您可以看到最新的公共预览版是预览版 5。因此,您或您用于迁移的工具正在尝试使用夜间构建.NET Core SDK 的版本,而不是已发布的版本。.NET SDK 通常随附在 NuGet 回退文件夹中的包,因此 .NET Core SDK 的版本似乎没有正确安装。
I know nothing of that extension you linked, plus it's not a Microsoft extension, so while I appreciate the effort the developer made to create it, I don't know if it works "correctly". Plus .NET Core 3.0 still isn't generally available, so maybe the extension worked with previous previews but something changed.
我对您链接的那个扩展一无所知,而且它不是 Microsoft 扩展,所以虽然我感谢开发人员为创建它所做的努力,但我不知道它是否“正确”工作。此外,.NET Core 3.0 仍然不普遍可用,因此该扩展可能适用于以前的预览版,但有所改变。
My suggestion is to install the latest .NET Core 3.0 preview from the download page, go to an empty directory and run "dotnet new wpf", then copy all your code and xaml into that new directory. I don't trust migration tools, I prefer to do it myself manually, so I understand what's being changed.
我的建议是从下载页面安装最新的 .NET Core 3.0 预览版,转到一个空目录并运行“dotnet new wpf”,然后将所有代码和 xaml 复制到该新目录中。我不相信迁移工具,我更喜欢自己手动完成,所以我了解正在更改的内容。

