.Net Core 1.1.0 NuGet 包无法在 Visual Studio Mac 中安装 [英] .Net Core 1.1.0 NuGet packages fail to install in Visual Studio Mac

查看:39
本文介绍了.Net Core 1.1.0 NuGet 包无法在 Visual Studio Mac 中安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Visual Studio Mac 预览版中使用 ASPNet.Core 1.1.0 应用程序,但在更新/安装 NuGet 包时遇到问题.

如果我尝试更新,例如.Microsoft.AspNetCore.Diagnostics 从 1.0.0 到 1.1.0 下载失败并完全删除了包.然后我必须再次下载并安装 1.0.0 的包.Microsoft.AspNetCore.Server.Kestrel 也是如此.

Microsoft.EntityFrameworkCore 我无法在任何版本中安装.下面是异常输出:https://gist.github.com/anonymous/52ceb28b8d9781835b226bcbe9d04d

我知道一切都刚刚好,但想知道其他人是否遇到过同样的问题并知道解决方法/解决方案.

对于遇到类似问题的其他人,这里有一个演练:

  1. 首先安装 .NET Core 1.1.0:https://www.microsoft.com/net/core#macos

  2. 官方 .NET Core 1.1.0 安装程序(截至撰写本文时)包括 .NET Core SDK 1.0.0 Preview 2.

您将需要 .NET Core SDK 1.0.0 Preview 3.在此处下载:https://github.com/dotnet/core/blob/master/release-notes/preview3-download.md

  1. 在 Visual Studio Mac 中创建一个新项目

  2. 关闭项目

  3. 打开 project/src/myapp/myapp.csproj 并将netcoreapp1.0"更改为netcoreapp1.1".保存并关闭文件.

netcoreapp1.1

  1. 在 Visual Studio Mac 中打开您的解决方案并编译它.

现在您可以将 NuGet 包更新到最新版本.

如果您遇到问题,请在/project/src/myapp/中进行dotnet 恢复"

I'm playing around with a ASPNet.Core 1.1.0 application in Visual Studio Mac Preview and have problems updating/installing NuGet packages.

If I try to update eg. Microsoft.AspNetCore.Diagnostics from 1.0.0 to 1.1.0 it fails the download and removed the package completely. I then have to download and install the package for 1.0.0 again. Same goes for Microsoft.AspNetCore.Server.Kestrel.

Microsoft.EntityFrameworkCore I'm not able to install in any version. Heres the exception output: https://gist.github.com/anonymous/52ceb28b8d9781835b226bcbe9d04d58

I know everything is right out of the oven, but was wondering if other people have experienced the same issues and know of a workaround/solution.

解决方案

For everyone else having similar problems, here's a walk-through:

  1. First install .NET Core 1.1.0: https://www.microsoft.com/net/core#macos

  2. The official .NET Core 1.1.0 installer (as of when this is written) includes the .NET Core SDK 1.0.0 Preview 2.

You will need .NET Core SDK 1.0.0 Preview 3. Download it here: https://github.com/dotnet/core/blob/master/release-notes/preview3-download.md

  1. Create a new project in Visual Studio Mac

  2. Close the project

  3. Open up project/src/myapp/myapp.csproj and change "netcoreapp1.0" to "netcoreapp1.1". Save and close the file.

<TargetFramework>netcoreapp1.1</TargetFramework>

  1. Open your solution in Visual Studio Mac and compile it.

Now you will be able to update your NuGet packages to newest versions.

Should you run into problems, do a "dotnet restore" when standing in /project/src/myapp/

这篇关于.Net Core 1.1.0 NuGet 包无法在 Visual Studio Mac 中安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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