我正在尝试将我的 WPF(.net framework) 项目迁移到 WPF(.net core 3)。
所以我安装了 this Visual Studio Extension我现在可以创建一个新的 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
最佳答案
由于 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>
这将确保可以找到预览版本!
可在此处找到此信息:
https://github.com/dotnet/core-sdk#installers-and-binaries
一旦 dotnet core 3.0 发布,您应该能够删除这些包源。
关于wpf - 无法找到版本 (>=3.0.0) 的软件包 Microsoft.NETCore.App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56491961/