简体   繁体   中英

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. I'm downloading the packages from NuGet. my friend can normally download all OWIN packages on his machine, but It's not working on my machine. I tried removing Visual studio cache, TFS cache, VSCommon cache, resetting visual studio, I also tried reinstalling visual studio, and nothing is working. 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:

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', but the package does not contain any assembly references or content files that are compatible with that framework. 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.

I tried flushing my user cache and even uninstalling and reinstalling Visual Studio (deleting any AppData files that seemed related), but the problem persisted.

However, clearing the data in C:\\Users\\<<UserName>>\\.nuget\\packages has resolved the issue.

In my case,i solved it like this

I used Jetbrains rider in mac with a project targeting .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

simply worked !

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM