VS2013 Pro Update 1:加载Microsoft.Owin.Security的SPA Web应用程序模板错误

时间:2014-03-07 18:58:13

标签: angularjs twitter-bootstrap asp.net-web-api typescript

我开始使用SPA的VS2013标准模板:我想基于Typescript,AngularJS和Bootstrap 3以及服务器端的WebAPI构建一个简单的Web应用程序;在标准模板中,我找到一个SPA,它是基于Knockout但可以作为起点。所以我尝试使用它,但在更新所有NuGet包后,我在启动时不断收到此异常:

  

无法加载文件或程序集'Microsoft.Owin.Security.OAuth,   Version = 2.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或   其中一个依赖项。定位程序集的清单定义   与程序集引用不匹配

您需要做的就是 repro 这是创建一个新的SPA Web应用程序,更新所有NuGet包并运行。

  • 我试图双击版本冲突警告,但似乎VS无法自动解决它。
  • 我试图为这个程序集添加2.1.0.0的绑定,就像(我删除了标签,因为它们似乎在这篇文章中引起了混乱):

    ... assemblyIdentity name =“Microsoft.Owin.Security.OAuth”publicKeyToken =“31bf3856ad364e35”culture =“neutral”... bindingRedirect oldVersion =“0.0.0.0-2.1.0.0”newVersion =“2.1.0.0”

但这不会删除异常。

  • 我试图删除bin文件夹并重建所有文件夹,没有运气。

任何人都可以根据我的要求给出提示或建议更好的模板吗?

1 个答案:

答案 0 :(得分:0)

老实说,我花了很多时间去删除像Owin这样的库来设置一个干净的项目模板。我的建议是你做同样的事情......只需使用你的nuget包管理器将它们全部删除。只需假脱机基本应用程序。

以下是我为此次活动留下的一个清单。 (如果你不去那条路线,则省略MVC特定的图书馆)

<packages>
  <package id="Angular.UI.Bootstrap" version="0.11.0" targetFramework="net45" />
  <package id="Angular.UI.UI-Router" version="0.2.10" targetFramework="net45" />
  <package id="AngularJS.Animate" version="1.2.16" targetFramework="net45" />
  <package id="AngularJS.Core" version="1.2.16" targetFramework="net45" />
  <package id="AngularJS.Locale" version="1.2.16" targetFramework="net45" />
  <package id="AngularJS.Resource" version="1.2.16" targetFramework="net45" />
  <package id="AngularJS.Touch" version="1.2.16" targetFramework="net45" />
  <package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
  <package id="bootstrap" version="3.0.0" targetFramework="net45" />
  <package id="EntityFramework" version="6.1.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Identity.Core" version="2.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Identity.EntityFramework" version="2.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Mvc" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.Razor" version="3.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages" version="3.1.2" targetFramework="net45" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net45" />
  <package id="sugarjs" version="1.4.1" targetFramework="net45" />
  <package id="WebGrease" version="1.5.2" targetFramework="net45" />
</packages>