6
votes

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.

3
@BJMyers I tried this and it doesn't workIbraheem Al-Saady

3 Answers

12
votes

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.

1
votes

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 !

0
votes

Run UnInstall-Package Owin in Package Manager console and then Install-Package Owin, after that probably the same error will occor with Package Microsoft.Owin.Host.SystemWeb, run the above command to uninstall and install to solve the problem.