简体   繁体   中英

Could not install package 'Microsoft.Owin.Security 2.0.2'

i am trying to install SignalR on my Website ( Not a Web application ) (using visual studio 2012 ), when i created my website ( File--New Website ) i selected .net 4.5, my problem is when i am installing SignalR with Nuget Package this error happens

Install failed. Rolling back... 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 that are compatible with that framework. For more information, contact the package author.

on also in my web.config line <httpRuntime targetFramework="4.5"/> says

the targetFramework attribute is not allowed.

and my web.config is

    <?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="KutSocialNetworkConnectionString" connectionString="Data Source=.;Initial Catalog=KutSocialNetwork;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <appSettings>
    <add key="path" value=""/>
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
  </appSettings>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="UrlRoutingModule"/>
      <add name="UrlRoutingModule"
           type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </modules>
    <handlers>
      <add name="UrlRoutingHandler"
           preCondition="integratedMode"
           verb="*"
           path="UrlRouting.axd"
           type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </handlers>
  </system.webServer>

</configuration>

因此很简单,我直接从Nuget下载,还删除了我的webconfig并创建了一个新的

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