質問

I'm try to install owin.security on my asp.net mvc 4 application from here https://www.nuget.org/packages/Owin.Security.Providers/ , but have an error:

Install-Package : Could not install package 'Microsoft.Owin.Security 2.0.2'. You are trying to install this package into a project that targets 
'.NETFramework,Version=v4.0', 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.
At line:1 char:1
+ Install-Package Owin.Security.Providers
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException

I was try to search in google, but found information only about SignalR. Can anybody help me?

役に立ちましたか?

解決

I'm very surprised. I searched for system requirements for Microsoft OWIN aka Katana. I had a hard time finding a definitive answer on this as well.

So when in doubt, head to the source:

https://katanaproject.codeplex.com/SourceControl/latest#src/Microsoft.Owin.Security/Microsoft.Owin.Security.csproj

According to the project file:

    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

That is why NuGet won't let you install the package. You need to update your project to .NET 4.5 Framework.

他のヒント

I had the same problem with an existing project that I am working on, try this

Install-Package Microsoft.Owin.Host.SystemWeb -Version 2.1.0

better to install a little older version of Owin, because .NET framework 4.0 doesn't support newer versions. But you will get almost all the features.

SignalR 2.0 does not support .net 4.0. Either do a upgrade of .net or use a 1.x version of SignalR.

>Install-Package Microsoft.AspNet.SignalR -Version 1.1.3

Source

I also got the same error during installing Microsoft.Owin.Security 2.0.2.After that, i have changed my .net framework from 4.0 to 4.5 and it worked.

In my case, I had just pulled an existing project into my solution and was getting the error. One project was at 4.5 and the other was at 4.51. Putting them at the same framework release solved the problem.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top