简体   繁体   English

无法安装软件包“ Owin 1.0.0”。 您正在尝试将此软件包安装到以'.NETFramework,Version = v4.5.2'为目标的项目中

[英]Could not install package 'Owin 1.0.0.' You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2'

I'm trying to implement OAuth on my ASP.NET Web Api project. 我正在尝试在我的ASP.NET Web Api项目上实现OAuth。 I'm downloading the packages from NuGet. 我正在从NuGet下载软件包。 my friend can normally download all OWIN packages on his machine, but It's not working on my machine. 我的朋友通常可以在他的计算机上下载所有OWIN软件包,但是在我的计算机上不起作用。 I tried removing Visual studio cache, TFS cache, VSCommon cache, resetting visual studio, I also tried reinstalling visual studio, and nothing is working. 我尝试删除Visual Studio缓存,TFS缓存,VSCommon缓存,重置Visual Studio,还尝试重新安装Visual Studio,但没有任何效果。 I also tried all .net framework versions from 4.0 to 4.6.1 I'm using Visual Studio 2015 community update 1. The error I'm getting looks like the following: 我还尝试了从4.0到4.6.1的所有.net框架版本,我正在使用Visual Studio 2015社区更新1。我遇到的错误如下所示:

Could not install package 'Owin 1.0.0'. 无法安装软件包“ Owin 1.0.0”。 You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', but the package does not contain any assembly references or content files that are compatible with that framework. 您正在尝试将此软件包安装到以'.NETFramework,Version = v4.5.2'为目标的项目中,但是该软件包不包含任何与该框架兼容的程序集引用或内容文件。 For more information, contact the package author. 有关更多信息,请与软件包作者联系。

I believe I found the solution. 我相信我找到了解决方案。

I ran into the same issue, and it was impacting more than just the Owin package. 我遇到了同样的问题,它的影响不仅限于Owin软件包。

I tried flushing my user cache and even uninstalling and reinstalling Visual Studio (deleting any AppData files that seemed related), but the problem persisted. 我尝试刷新用户缓存,甚至卸载并重新安装Visual Studio(删除所有似乎相关的AppData文件),但问题仍然存在。

However, clearing the data in C:\\Users\\<<UserName>>\\.nuget\\packages has resolved the issue. 但是,清除C:\\Users\\<<UserName>>\\.nuget\\packages已解决了该问题。

In my case,i solved it like this 就我而言,我这样解决了

I used Jetbrains rider in mac with a project targeting .net 4.5 我在Mac中使用Jetbrains rider,目标是.net 4.5。

none of the solutions worked,then i just simply went to project settings and updated the target .net version of the app 没有任何解决方案有效,然后我只是转到项目设置并更新了应用程序的目标.net版本

simply worked ! 简单地工作!

在Package Manager控制台中运行UnInstall-Package Owin ,然后运行Install-Package Owin ,此后,Package Microsoft.Owin.Host.SystemWeb可能会出现相同的错误,请运行上述命令进行卸载并安装以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法安装软件包“ EfSchemaCompare.EF6 1.0.0” - Could not install package 'EfSchemaCompare.EF6 1.0.0' 无法安装软件包“ Microsoft.Owin.Security 2.0.1” - Could not install package 'Microsoft.Owin.Security 2.0.1' 无法安装软件包“ Microsoft.Owin.Security 2.0.2” - Could not install package 'Microsoft.Owin.Security 2.0.2' 通过代码将sitecore包安装到所有目标 - Install sitecore package through code to all targets 无法安装nuget软件包Microsoft.AspNet.Identity.Owin-版本2.1.0 - Unable to install nuget package Microsoft.AspNet.Identity.Owin -Version 2.1.0 Package 'Microsoft.AspNet.Mvc 5.2.7' 已使用 '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, - Package 'Microsoft.AspNet.Mvc 5.2.7' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, 无法安装NuGet套件 - Cannot install NuGet Package 软件包&#39;Microsoft.PortableLibrary.TargetingPack.Msi,version = 15.0.26228.0&#39;无法安装 - Package 'Microsoft.PortableLibrary.TargetingPack.Msi,version=15.0.26228.0' failed to install 尝试在Visual Studio中安装Bower软件包时出错 - Error when trying to install Bower package in Visual Studio .NETFramework的.NetStandard nuget包问题 - .NetStandard nuget package issues with .NETFramework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM